diff options
-rw-r--r-- | yaksh/models.py | 8 | ||||
-rw-r--r-- | yaksh/tests.py | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index c48eef1..ddfd5db 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -163,7 +163,9 @@ class Profile(models.Model): department = models.CharField(max_length=64) position = models.CharField(max_length=64) timezone = models.CharField(max_length=64, - choices=[(tz, tz) for tz in pytz.common_timezones]) + default=pytz.utc.zone, + choices=[(tz, tz) for tz in pytz.common_timezones] + ) ############################################################################### @@ -340,7 +342,9 @@ class QuizManager(models.Manager): trial_quiz.duration = 1000 trial_quiz.active = True trial_quiz.start_date_time = timezone.now() - trial_quiz.end_date_time = datetime(2199, 1, 1, 0, 0, 0, 0) + trial_quiz.end_date_time = datetime(2199, 1, 1, 0, 0, 0, 0, + tzinfo=pytz.utc + ) trial_quiz.save() return trial_quiz diff --git a/yaksh/tests.py b/yaksh/tests.py index e65e699..9b5971c 100644 --- a/yaksh/tests.py +++ b/yaksh/tests.py @@ -230,8 +230,9 @@ class QuizTestCases(unittest.TestCase): self.assertEqual(trial_quiz.duration, 1000) self.assertTrue(trial_quiz.active) self.assertEqual(trial_quiz.end_date_time, - datetime(2199, 1, 1, 0, 0, 0, 0) - ) + datetime(2199, 1, 1, 0, 0, 0, 0, + tzinfo=pytz.utc.zone) + ) self.assertEqual(trial_quiz.time_between_attempts, 0) def test_create_trial_from_quiz_usermode(self): |