Merge pull request #6478 from edx/jeskew/change_handled_exception_for_assets
Handle the correct exception upon asset not found.
This commit is contained in:
@@ -840,9 +840,16 @@ class MiscCourseTests(ContentStoreTestCase):
|
||||
self.store.unpublish(self.chapter_loc, self.user.id)
|
||||
|
||||
def test_bad_contentstore_request(self):
|
||||
resp = self.client.get_html('http://localhost:8001/c4x/CDX/123123/asset/&images_circuits_Lab7Solution2.png')
|
||||
"""
|
||||
Test that user get proper responses for urls with invalid url or
|
||||
asset/course key
|
||||
"""
|
||||
resp = self.client.get_html('/c4x/CDX/123123/asset/&invalid.png')
|
||||
self.assertEqual(resp.status_code, 400)
|
||||
|
||||
resp = self.client.get_html('/c4x/CDX/123123/asset/invalid.png')
|
||||
self.assertEqual(resp.status_code, 404)
|
||||
|
||||
def test_delete_course(self):
|
||||
"""
|
||||
This test creates a course, makes a draft item, and deletes the course. This will also assert that the
|
||||
|
||||
Reference in New Issue
Block a user