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
c2cf9ae0
Commit
c2cf9ae0
authored
Sep 16, 2015
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! Fix broken unit tests.
parent
8c5f9297
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
lms/djangoapps/course_structure_api/v0/views.py
+2
-2
lms/djangoapps/courseware/tests/test_access.py
+2
-2
lms/djangoapps/discussion_api/tests/test_views.py
+3
-3
No files found.
lms/djangoapps/course_structure_api/v0/views.py
View file @
c2cf9ae0
...
@@ -658,8 +658,8 @@ class CourseBlocksAndNavigation(ListAPIView):
...
@@ -658,8 +658,8 @@ class CourseBlocksAndNavigation(ListAPIView):
method, add the response from the 'student_view_json" method as the data for the block.
method, add the response from the 'student_view_json" method as the data for the block.
"""
"""
if
block_info
.
type
in
request_info
.
block_json
:
if
block_info
.
type
in
request_info
.
block_json
:
if
getattr
(
block_info
.
block
,
'student_view_
json
'
,
None
):
if
getattr
(
block_info
.
block
,
'student_view_
data
'
,
None
):
block_info
.
value
[
"block_json"
]
=
block_info
.
block
.
student_view_
json
(
block_info
.
value
[
"block_json"
]
=
block_info
.
block
.
student_view_
data
(
context
=
request_info
.
block_json
[
block_info
.
type
]
context
=
request_info
.
block_json
[
block_info
.
type
]
)
)
...
...
lms/djangoapps/courseware/tests/test_access.py
View file @
c2cf9ae0
...
@@ -207,7 +207,7 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -207,7 +207,7 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
@ddt.data
(
None
,
YESTERDAY
,
TOMORROW
)
@ddt.data
(
None
,
YESTERDAY
,
TOMORROW
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch
(
'courseware.access.get_current_request_hostname'
,
Mock
(
return_value
=
'preview.localhost'
))
@patch
(
'courseware.access
_utils
.get_current_request_hostname'
,
Mock
(
return_value
=
'preview.localhost'
))
def
test__has_access_descriptor_in_preview_mode
(
self
,
start
):
def
test__has_access_descriptor_in_preview_mode
(
self
,
start
):
"""
"""
Tests that descriptor has access in preview mode.
Tests that descriptor has access in preview mode.
...
@@ -225,7 +225,7 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -225,7 +225,7 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
)
# ddt throws an error if I don't put the None argument there
)
# ddt throws an error if I don't put the None argument there
@ddt.unpack
@ddt.unpack
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch
(
'courseware.access.get_current_request_hostname'
,
Mock
(
return_value
=
'localhost'
))
@patch
(
'courseware.access
_utils
.get_current_request_hostname'
,
Mock
(
return_value
=
'localhost'
))
def
test__has_access_descriptor_when_not_in_preview_mode
(
self
,
start
,
expected_error_type
):
def
test__has_access_descriptor_when_not_in_preview_mode
(
self
,
start
,
expected_error_type
):
"""
"""
Tests that descriptor has no access when start date in future & without preview.
Tests that descriptor has no access when start date in future & without preview.
...
...
lms/djangoapps/discussion_api/tests/test_views.py
View file @
c2cf9ae0
...
@@ -83,7 +83,7 @@ class CourseViewTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
...
@@ -83,7 +83,7 @@ class CourseViewTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assert_response_correct
(
self
.
assert_response_correct
(
response
,
response
,
404
,
404
,
{
"developer_message"
:
"
N
ot found."
}
{
"developer_message"
:
"
Course n
ot found."
}
)
)
def
test_get_success
(
self
):
def
test_get_success
(
self
):
...
@@ -116,7 +116,7 @@ class CourseTopicsViewTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
...
@@ -116,7 +116,7 @@ class CourseTopicsViewTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assert_response_correct
(
self
.
assert_response_correct
(
response
,
response
,
404
,
404
,
{
"developer_message"
:
"
N
ot found."
}
{
"developer_message"
:
"
Course n
ot found."
}
)
)
def
test_get_success
(
self
):
def
test_get_success
(
self
):
...
@@ -159,7 +159,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
...
@@ -159,7 +159,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assert_response_correct
(
self
.
assert_response_correct
(
response
,
response
,
404
,
404
,
{
"developer_message"
:
"
N
ot found."
}
{
"developer_message"
:
"
Course n
ot found."
}
)
)
def
test_basic
(
self
):
def
test_basic
(
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