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
1e0f3ddb
Commit
1e0f3ddb
authored
Nov 30, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s/pylint: disable=E1111,E1124/pylint: disable=assignment-from-no-return,redundant-keyword-arg/
parent
b4d24f36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
common/djangoapps/third_party_auth/tests/test_change_enrollment.py
+4
-4
lms/djangoapps/instructor/tests/test_api.py
+5
-5
No files found.
common/djangoapps/third_party_auth/tests/test_change_enrollment.py
View file @
1e0f3ddb
...
...
@@ -62,7 +62,7 @@ class PipelineEnrollmentTest(ModuleStoreTestCase):
strategy
=
self
.
_fake_strategy
()
strategy
.
session_set
(
'enroll_course_id'
,
unicode
(
self
.
course
.
id
))
result
=
pipeline
.
change_enrollment
(
strategy
,
1
,
user
=
self
.
user
)
# pylint: disable=
E1111,E1124
result
=
pipeline
.
change_enrollment
(
strategy
,
1
,
user
=
self
.
user
)
# pylint: disable=
assignment-from-no-return,redundant-keyword-arg
self
.
assertEqual
(
result
,
{})
# Check that the user was or was not enrolled
...
...
@@ -86,7 +86,7 @@ class PipelineEnrollmentTest(ModuleStoreTestCase):
# Simulate the pipeline step for enrolling in this course
strategy
=
self
.
_fake_strategy
()
strategy
.
session_set
(
'enroll_course_id'
,
unicode
(
self
.
course
.
id
))
result
=
pipeline
.
change_enrollment
(
strategy
,
1
,
user
=
self
.
user
)
# pylint: disable=
E1111,E1124
result
=
pipeline
.
change_enrollment
(
strategy
,
1
,
user
=
self
.
user
)
# pylint: disable=
assignment-from-no-return,redundant-keyword-arg
self
.
assertEqual
(
result
,
{})
# Expect that the uesr is NOT enrolled in the course
...
...
@@ -109,7 +109,7 @@ class PipelineEnrollmentTest(ModuleStoreTestCase):
# This should fail silently, with no exception
strategy
=
self
.
_fake_strategy
()
strategy
.
session_set
(
'enroll_course_id'
,
unicode
(
self
.
course
.
id
))
result
=
pipeline
.
change_enrollment
(
strategy
,
1
,
user
=
self
.
user
)
# pylint: disable=
E1111,E1124
result
=
pipeline
.
change_enrollment
(
strategy
,
1
,
user
=
self
.
user
)
# pylint: disable=
assignment-from-no-return,redundant-keyword-arg
self
.
assertEqual
(
result
,
{})
# Verify that we were NOT enrolled
...
...
@@ -117,7 +117,7 @@ class PipelineEnrollmentTest(ModuleStoreTestCase):
def
test_no_course_id_skips_enroll
(
self
):
strategy
=
self
.
_fake_strategy
()
result
=
pipeline
.
change_enrollment
(
strategy
,
1
,
user
=
self
.
user
)
# pylint: disable=
E1111,E1124
result
=
pipeline
.
change_enrollment
(
strategy
,
1
,
user
=
self
.
user
)
# pylint: disable=
assignment-from-no-return,redundant-keyword-arg
self
.
assertEqual
(
result
,
{})
self
.
assertFalse
(
CourseEnrollment
.
is_enrolled
(
self
.
user
,
self
.
course
.
id
))
...
...
lms/djangoapps/instructor/tests/test_api.py
View file @
1e0f3ddb
...
...
@@ -2,7 +2,7 @@
"""
Unit tests for instructor.api methods.
"""
# pylint: disable=E1111
import
unittest
import
json
import
requests
...
...
@@ -111,26 +111,26 @@ class TestCommonExceptions400(unittest.TestCase):
def
test_user_doesnotexist
(
self
):
self
.
request
.
is_ajax
.
return_value
=
False
resp
=
view_user_doesnotexist
(
self
.
request
)
resp
=
view_user_doesnotexist
(
self
.
request
)
# pylint: disable=assignment-from-no-return
self
.
assertEqual
(
resp
.
status_code
,
400
)
self
.
assertIn
(
"User does not exist"
,
resp
.
content
)
def
test_user_doesnotexist_ajax
(
self
):
self
.
request
.
is_ajax
.
return_value
=
True
resp
=
view_user_doesnotexist
(
self
.
request
)
resp
=
view_user_doesnotexist
(
self
.
request
)
# pylint: disable=assignment-from-no-return
self
.
assertEqual
(
resp
.
status_code
,
400
)
result
=
json
.
loads
(
resp
.
content
)
self
.
assertIn
(
"User does not exist"
,
result
[
"error"
])
def
test_alreadyrunningerror
(
self
):
self
.
request
.
is_ajax
.
return_value
=
False
resp
=
view_alreadyrunningerror
(
self
.
request
)
resp
=
view_alreadyrunningerror
(
self
.
request
)
# pylint: disable=assignment-from-no-return
self
.
assertEqual
(
resp
.
status_code
,
400
)
self
.
assertIn
(
"Task is already running"
,
resp
.
content
)
def
test_alreadyrunningerror_ajax
(
self
):
self
.
request
.
is_ajax
.
return_value
=
True
resp
=
view_alreadyrunningerror
(
self
.
request
)
resp
=
view_alreadyrunningerror
(
self
.
request
)
# pylint: disable=assignment-from-no-return
self
.
assertEqual
(
resp
.
status_code
,
400
)
result
=
json
.
loads
(
resp
.
content
)
self
.
assertIn
(
"Task is already running"
,
result
[
"error"
])
...
...
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