From af9b7ddeb637278a7705964ba98c8e6a2e7307f4 Mon Sep 17 00:00:00 2001 From: maxbr Date: Mon, 17 Oct 2016 14:56:11 +0200 Subject: Add unit tests JIRA: RELENG-12 This commit increases test statement coverage to 84%. It also fixes the bugs that emerged while testing. Change-Id: I696091f1a07f8b7647872c7cb15f4368a4690619 Signed-off-by: maxbr --- tools/pharos-dashboard/src/account/tests/test_general.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/pharos-dashboard/src/account/tests/test_general.py') diff --git a/tools/pharos-dashboard/src/account/tests/test_general.py b/tools/pharos-dashboard/src/account/tests/test_general.py index 72e7ea11..e8f483b5 100644 --- a/tools/pharos-dashboard/src/account/tests/test_general.py +++ b/tools/pharos-dashboard/src/account/tests/test_general.py @@ -48,3 +48,13 @@ class AccountMiddlewareTestCase(TestCase): self.user1profile.save() self.client.get(url) self.assertEqual(timezone.get_current_timezone_name(), 'Etc/Greenwich') + + # if there is no profile for a user, it should be created + user2 = User.objects.create(username='user2') + user2.set_password('user2') + user2.save() + self.client.login(username='user2', password='user2') + self.client.get(url) + self.assertTrue(user2.userprofile) + + -- cgit 1.2.3-korg