From 23da5cc83a4c54742ad73f750e60cf0e3611a1f9 Mon Sep 17 00:00:00 2001 From: Shtalinberg Oleksandr Date: Wed, 12 Dec 2018 14:10:22 +0200 Subject: [PATCH] add first test for model --- actionslog/tests/test_models.py | 29 +++++++++++++++++++++++++++++ tests/requirements.pip | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 actionslog/tests/test_models.py diff --git a/actionslog/tests/test_models.py b/actionslog/tests/test_models.py new file mode 100644 index 0000000..d1c0c24 --- /dev/null +++ b/actionslog/tests/test_models.py @@ -0,0 +1,29 @@ + +"""Model tests.""" + +from __future__ import unicode_literals + +from django.contrib.auth.models import User +from django.test import TestCase +# from django.utils.encoding import force_text + +from actionslog.models import LogAction + + +class ModelTestCase(TestCase): + """This class defines the test suite for the bucketlist model.""" + + def setUp(self): + """Define the test client and other test variables.""" + self.user = User.objects.create(username="nerd") # ADD THIS LINE + self.status_msg = 'Reset password success' + + + def test_model_manager(self): + la_kwargs = { + 'instance': self.user, + 'user': self.user, + 'action_info': {'info': self.status_msg}, + } + LogAction.objects.create_log_action(**la_kwargs) + diff --git a/tests/requirements.pip b/tests/requirements.pip index 85071d7..a5ce4ae 100644 --- a/tests/requirements.pip +++ b/tests/requirements.pip @@ -3,7 +3,7 @@ #django==1.11.17 django-jsonfield>=0.9.15 pytz>=2015.7 -django-nose==1.4.2 +django-nose==1.4.6 nose==1.3.7 selenium==2.48.0 coverage==4.5.2