Assign valid content_type to static resource (import_static_content)

STUD-878
This commit is contained in:
zubiar-arbi
2014-01-03 18:27:26 +05:00
parent 5dccff518c
commit b998a161d2
4 changed files with 24 additions and 4 deletions

View File

@@ -61,6 +61,14 @@ class AssetsToyCourseTestCase(CourseTestCase):
self.assertContains(resp, "new AssetCollection([{")
self.assertContains(resp, "/c4x/edX/toy/asset/handouts_sample_handout.txt")
# Test valid contentType for pdf asset (textbook.pdf)
self.assertContains(resp, "/c4x/edX/toy/asset/textbook.pdf")
asset_location = StaticContent.get_location_from_path('/c4x/edX/toy/asset/textbook.pdf')
content = contentstore().find(asset_location)
# Check after import textbook.pdf has valid contentType ('application/pdf')
# Note: Actual contentType for textbook.pdf in asset.json is 'text/pdf'
self.assertEqual(content.content_type, 'application/pdf')
class UploadTestCase(CourseTestCase):
"""