Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, April 9th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
361af7ef
Commit
361af7ef
authored
7 years ago
by
McKenzie Welter
Browse files
Options
Downloads
Patches
Plain Diff
add test coverage for entitlement course run retrieval
parent
e60e7927
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/entitlements/tests/test_utils.py
+26
-0
26 additions, 0 deletions
common/djangoapps/entitlements/tests/test_utils.py
with
26 additions
and
0 deletions
common/djangoapps/entitlements/tests/test_utils.py
+
26
−
0
View file @
361af7ef
...
...
@@ -75,6 +75,20 @@ class TestCourseRunFulfillableForEntitlement(ModuleStoreTestCase):
entitlement
)
def
test_course_run_not_fulfillable_no_start_date
(
self
):
course_overview
=
self
.
create_course
(
start_from_now
=-
2
,
end_from_now
=
2
,
enrollment_start_from_now
=-
1
,
enrollment_end_from_now
=
1
)
course_overview
.
start
=
None
course_overview
.
save
()
entitlement
=
CourseEntitlementFactory
.
create
(
mode
=
CourseMode
.
VERIFIED
)
assert
not
is_course_run_entitlement_fulfillable
(
course_overview
.
id
,
entitlement
)
def
test_course_run_not_fulfillable_run_ended
(
self
):
course_overview
=
self
.
create_course
(
start_from_now
=-
3
,
...
...
@@ -99,6 +113,18 @@ class TestCourseRunFulfillableForEntitlement(ModuleStoreTestCase):
assert
not
is_course_run_entitlement_fulfillable
(
course_overview
.
id
,
entitlement
)
def
test_course_run_not_fulfillable_enrollment_start_in_future
(
self
):
course_overview
=
self
.
create_course
(
start_from_now
=-
3
,
end_from_now
=
2
,
enrollment_start_from_now
=
2
,
enrollment_end_from_now
=
4
)
entitlement
=
CourseEntitlementFactory
.
create
(
mode
=
CourseMode
.
VERIFIED
)
assert
not
is_course_run_entitlement_fulfillable
(
course_overview
.
id
,
entitlement
)
def
test_course_run_fulfillable_user_enrolled
(
self
):
course_overview
=
self
.
create_course
(
start_from_now
=-
3
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment