Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
10ef6f5c
Commit
10ef6f5c
authored
Nov 20, 2017
by
Albert St. Aubin
Committed by
Harry Rein
Dec 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds one more test for Entitlement enrollment.
parent
828ca183
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletions
+16
-1
common/djangoapps/enrollment/tests/test_views.py
+16
-0
common/djangoapps/entitlements/models.py
+0
-1
No files found.
common/djangoapps/enrollment/tests/test_views.py
View file @
10ef6f5c
...
...
@@ -5,6 +5,7 @@ import datetime
import
itertools
import
json
import
unittest
import
uuid
import
ddt
import
httpretty
...
...
@@ -210,6 +211,21 @@ class EntitlementEnrollmentTest(EnrollmentTestMixin, ModuleStoreTestCase, APITes
entitlement
.
refresh_from_db
()
self
.
assertIsNone
(
entitlement
.
enrollment_course_run
)
def
test_enroll_no_entitlement
(
self
):
resp
=
self
.
assert_enrollment_status
(
course_id
=
unicode
(
self
.
course
.
id
),
course_uuid
=
str
(
uuid
.
uuid4
()),
is_active
=
True
,
mode
=
None
,
max_mongo_calls
=
4
,
expected_status
=
status
.
HTTP_400_BAD_REQUEST
)
data
=
json
.
loads
(
resp
.
content
)
self
.
assertEqual
(
self
.
course
.
display_name_with_default
,
data
[
'course_details'
][
'course_name'
])
# Verify that the enrollment was created correctly
self
.
assertFalse
(
CourseEnrollment
.
is_enrolled
(
self
.
user
,
self
.
course
.
id
))
@attr
(
shard
=
3
)
@override_settings
(
EDX_API_KEY
=
"i am a key"
)
...
...
common/djangoapps/entitlements/models.py
View file @
10ef6f5c
...
...
@@ -223,7 +223,6 @@ class CourseEntitlement(TimeStampedModel):
entitlement
=
cls
.
objects
.
get
(
user
=
user
,
course_uuid
=
course_uuid
,
expired_at
=
None
,
)
return
entitlement
except
cls
.
DoesNotExist
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment