Open a file in read binary mode to avoid bytes issues.
This commit is contained in:
Awais Qureshi
2019-10-18 19:40:33 +05:00
parent 523bb0ea5d
commit 544959026a

View File

@@ -398,7 +398,7 @@ class CourseFixture(XBlockContainerFixture):
for asset_name in self._assets:
asset_file_path = test_dir + '/data/uploads/' + asset_name
asset_file = open(asset_file_path)
asset_file = open(asset_file_path, mode='rb')
files = {'file': (asset_name, asset_file, mimetypes.guess_type(asset_file_path)[0])}
headers = {