Commit c2cf9ae0 by Nimisha Asthagiri

fixup! Fix broken unit tests.

parent 8c5f9297
...@@ -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]
) )
......
...@@ -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.
......
...@@ -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": "Not found."} {"developer_message": "Course not 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": "Not found."} {"developer_message": "Course not 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": "Not found."} {"developer_message": "Course not found."}
) )
def test_basic(self): def test_basic(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment