From 1f572a38c9ea2c19f8f02dbedebc21745e6e8ab8 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 18 Feb 2019 17:54:23 -0600 Subject: [PATCH 1/2] Do not set if_completed_before on newly created grading exceptions --- course/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/course/views.py b/course/views.py index 859869bb..5e470b2e 100644 --- a/course/views.py +++ b/course/views.py @@ -1233,7 +1233,6 @@ def grant_exception_stage_3(pctx, participation_id, flow_id, session_id): if due_local_naive is not None: new_grading_rule["due"] = due_local_naive - new_grading_rule["if_completed_before"] = due_local_naive for attr_name in ["credit_percent", "bonus_points", "max_points", "max_points_enforced_cap", "generates_grade"]: -- GitLab From 045a982dc6a905a1d6023be2f8aae1e6db729f9b Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 18 Feb 2019 23:22:43 -0600 Subject: [PATCH 2/2] Adapt tests for 'Do not set if_completed_before on newly created grading exceptions' --- tests/test_views.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/test_views.py b/tests/test_views.py index eca68398..d52db7cd 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -1968,10 +1968,7 @@ class GrantExceptionStage3Test(GrantExceptionTestMixin, TestCase): excs.filter( kind=constants.flow_rule_kind.grading).count(), 1) if_completed_before = excs[0].rule.get("if_completed_before") - due_naive = due.replace(tzinfo=None) - self.assertEqual(if_completed_before.date(), due_naive.date()) - self.assertEqual(if_completed_before.hour, due_naive.hour) - self.assertEqual(if_completed_before.minute, due_naive.minute) + self.assertIsNone(if_completed_before) self.assertAddMessageCallCount(1) self.assertAddMessageCalledWith("'Grading' exception granted to ") @@ -2000,12 +1997,7 @@ class GrantExceptionStage3Test(GrantExceptionTestMixin, TestCase): excs.filter( kind=constants.flow_rule_kind.grading).count(), 1) if_completed_before = excs[0].rule.get("if_completed_before") - - # access expiration time will be used - expiration_time_naive = expiration_time.replace(tzinfo=None) - self.assertEqual(if_completed_before.date(), expiration_time_naive.date()) - self.assertEqual(if_completed_before.hour, expiration_time_naive.hour) - self.assertEqual(if_completed_before.minute, expiration_time_naive.minute) + self.assertIsNone(if_completed_before) self.assertAddMessageCallCount(1) self.assertAddMessageCalledWith("'Grading' exception granted to ") -- GitLab