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
1b985a5c
Commit
1b985a5c
authored
Sep 28, 2016
by
Rene Sorel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix quality issues and broken order of execution
parent
66b32318
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
lms/djangoapps/mobile_api/users/tests.py
+4
-3
lms/djangoapps/mobile_api/users/views.py
+3
-0
No files found.
lms/djangoapps/mobile_api/users/tests.py
View file @
1b985a5c
...
...
@@ -274,7 +274,6 @@ class TestUserEnrollmentApi(UrlResetMixin, MobileAPITestCase, MobileAuthUserTest
response_discussion_url
=
response
.
data
[
0
][
'course'
][
'discussion_url'
]
# pylint: disable=E1101
self
.
assertIn
(
'/api/discussion/v1/courses/{}'
.
format
(
self
.
course
.
id
),
response_discussion_url
)
def
test_org_query
(
self
):
self
.
login
()
...
...
@@ -289,11 +288,13 @@ class TestUserEnrollmentApi(UrlResetMixin, MobileAPITestCase, MobileAuthUserTest
]
# Enroll in all the courses
self
.
assertEqual
(
len
(
response
.
data
),
3
)
for
course
in
courses
:
self
.
enroll
(
course
.
id
)
response
=
self
.
api_response
(
data
=
{
'org'
:
'edX'
})
response
=
self
.
api_response
(
data
=
{
'org'
:
'edX'
})
# Test for 3 expected courses
self
.
assertEqual
(
len
(
response
.
data
),
3
)
# Verify only edX courses are returned
for
entry
in
response
.
data
:
...
...
lms/djangoapps/mobile_api/users/views.py
View file @
1b985a5c
...
...
@@ -271,6 +271,9 @@ class UserCourseEnrollmentsList(generics.ListAPIView):
pagination_class
=
None
def
is_org
(
self
,
check_org
,
course_org
):
"""
Check course org matches request org param or no param provided
"""
return
check_org
is
None
or
(
check_org
.
lower
()
==
course_org
.
lower
())
def
get_queryset
(
self
):
...
...
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