diff --git a/common/djangoapps/entitlements/tests/test_utils.py b/common/djangoapps/entitlements/tests/test_utils.py index 85c7e4877b..8cf5874825 100644 --- a/common/djangoapps/entitlements/tests/test_utils.py +++ b/common/djangoapps/entitlements/tests/test_utils.py @@ -64,7 +64,7 @@ class TestCourseRunFullfillableForEntitlement(ModuleStoreTestCase): entitlement = CourseEntitlementFactory.create(mode=CourseMode.VERIFIED) - assert is_course_run_entitlement_fullfillable(course_overview.id, now(), entitlement) + assert is_course_run_entitlement_fullfillable(course_overview.id, entitlement) def test_course_run_not_fullfillable_run_ended(self): course_overview = self.create_course( @@ -76,7 +76,7 @@ class TestCourseRunFullfillableForEntitlement(ModuleStoreTestCase): entitlement = CourseEntitlementFactory.create(mode=CourseMode.VERIFIED) - assert not is_course_run_entitlement_fullfillable(course_overview.id, now() + timedelta(days=3), entitlement) + assert not is_course_run_entitlement_fullfillable(course_overview.id, entitlement) def test_course_run_not_fullfillable_enroll_period_ended(self): course_overview = self.create_course( @@ -88,7 +88,7 @@ class TestCourseRunFullfillableForEntitlement(ModuleStoreTestCase): entitlement = CourseEntitlementFactory.create(mode=CourseMode.VERIFIED) - assert not is_course_run_entitlement_fullfillable(course_overview.id, now() + timedelta(days=3), entitlement) + assert not is_course_run_entitlement_fullfillable(course_overview.id, entitlement) def test_course_run_fullfillable_user_enrolled(self): course_overview = self.create_course( @@ -102,7 +102,7 @@ class TestCourseRunFullfillableForEntitlement(ModuleStoreTestCase): # Enroll User in the Course, but do not update the entitlement CourseEnrollmentFactory.create(user=entitlement.user, course_id=course_overview.id) - assert is_course_run_entitlement_fullfillable(course_overview.id, now() + timedelta(days=3), entitlement) + assert is_course_run_entitlement_fullfillable(course_overview.id, entitlement) def test_course_run_not_fullfillable_upgrade_ended(self): course_overview = self.create_course( @@ -115,4 +115,4 @@ class TestCourseRunFullfillableForEntitlement(ModuleStoreTestCase): entitlement = CourseEntitlementFactory.create(mode=CourseMode.VERIFIED) - assert not is_course_run_entitlement_fullfillable(course_overview.id, now() + timedelta(days=3), entitlement) + assert not is_course_run_entitlement_fullfillable(course_overview.id, entitlement) diff --git a/common/djangoapps/entitlements/utils.py b/common/djangoapps/entitlements/utils.py index eb2270d9e0..1c9ce8271b 100644 --- a/common/djangoapps/entitlements/utils.py +++ b/common/djangoapps/entitlements/utils.py @@ -14,8 +14,8 @@ def is_course_run_entitlement_fullfillable(course_run_id, entitlement, compare_d Arguments: course_run_id (String): The id of the Course run that is being checked. - compare_date: The date and time that we are comparing against. Generally the current date and time. entitlement: The Entitlement that we are checking against. + compare_date: The date and time that we are comparing against. Defaults to timezone.now() Returns: bool: True if the Course Run is fullfillable for the CourseEntitlement.