This commit is contained in:
Albert St. Aubin
2018-01-29 13:06:17 -05:00
parent 12e77b27e4
commit 90d29550bb
2 changed files with 6 additions and 6 deletions

View File

@@ -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)

View File

@@ -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.