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
714d3b96
Commit
714d3b96
authored
Aug 06, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pylint fixes
parent
ef4220ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
14 deletions
+12
-14
lms/djangoapps/instructor/tests/test_api.py
+7
-9
lms/djangoapps/instructor/views/api.py
+5
-5
No files found.
lms/djangoapps/instructor/tests/test_api.py
View file @
714d3b96
"""
Unit tests for instructor.api methods.
"""
# pylint: disable=E1111
import
unittest
import
json
from
urllib
import
quote
...
...
@@ -28,24 +29,27 @@ from instructor_task.api_helper import AlreadyRunningError
@common_exceptions_400
def
view_success
(
request
):
def
view_success
(
request
):
# pylint: disable=W0613
"A dummy view for testing that returns a simple HTTP response"
return
HttpResponse
(
'success'
)
@common_exceptions_400
def
view_user_doesnotexist
(
request
):
def
view_user_doesnotexist
(
request
):
# pylint: disable=W0613
"A dummy view that raises a User.DoesNotExist exception"
raise
User
.
DoesNotExist
()
@common_exceptions_400
def
view_alreadyrunningerror
(
request
):
def
view_alreadyrunningerror
(
request
):
# pylint: disable=W0613
"A dummy view that raises an AlreadyRunningError exception"
raise
AlreadyRunningError
()
class
TestCommonExceptions400
(
unittest
.
TestCase
):
"""
Testing the common_exceptions_400 decorator.
"""
def
setUp
(
self
):
self
.
request
=
Mock
(
spec
=
HttpRequest
)
self
.
request
.
META
=
{}
...
...
@@ -749,12 +753,6 @@ class TestInstructorAPITaskLists(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertEqual
(
json
.
loads
(
response
.
content
),
expected_res
)
# class TestInstructorAPILevelsForums
# # list_forum_members
# # update_forum_role_membership
class
TestInstructorAPIHelpers
(
TestCase
):
""" Test helpers for instructor.api """
def
test_split_input_list
(
self
):
...
...
lms/djangoapps/instructor/views/api.py
View file @
714d3b96
...
...
@@ -189,7 +189,7 @@ def students_update_enrollment(request, course_id):
})
# catch and log any exceptions
# so that one error doesn't cause a 500.
except
Exception
as
exc
:
except
Exception
as
exc
:
# pylint: disable=W0703
log
.
exception
(
"Error while #{}ing student"
)
log
.
exception
(
exc
)
results
.
append
({
...
...
@@ -401,10 +401,10 @@ def get_distribution(request, course_id):
if
not
feature
is
None
:
p_dist
=
analytics
.
distributions
.
profile_distribution
(
course_id
,
feature
)
response_payload
[
'feature_results'
]
=
{
'feature'
:
p_dist
.
feature
,
'feature_display_name'
:
p_dist
.
feature_display_name
,
'data'
:
p_dist
.
data
,
'type'
:
p_dist
.
type
,
'feature'
:
p_dist
.
feature
,
'feature_display_name'
:
p_dist
.
feature_display_name
,
'data'
:
p_dist
.
data
,
'type'
:
p_dist
.
type
,
}
if
p_dist
.
type
==
'EASY_CHOICE'
:
...
...
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