Skip tests that can't succeed in Python3 + Django 1.11

There is a bug in the underlying management/base code that tries to make
all manageent command output be unicode.  This management command
outputs the binary tar file data and so breaks in python3.  In python2
the code is happy to pass bytes back and forth and in later versions of
django this is fixed.  Howevere it's not possible to get this test to
pass in Python3 and django 1.11
This commit is contained in:
Feanil Patel
2019-10-07 16:29:13 -04:00
parent 95fb0f11f8
commit 2d766e7b5d
2 changed files with 8 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ class Command(BaseCommand):
def _get_results(self, filename):
"""Load results from file"""
with open(filename) as f:
with open(filename, 'rb') as f:
results = f.read()
os.remove(filename)
return results

View File

@@ -89,6 +89,13 @@ class TestCourseExportOlx(ModuleStoreTestCase):
with tarfile.open(filename) as tar_file:
self.check_export_file(tar_file, test_course_key)
# There is a bug in the underlying management/base code that tries to make
# all manageent command output be unicode. This management command
# outputs the binary tar file data and so breaks in python3. In python2
# the code is happy to pass bytes back and forth and in later versions of
# django this is fixed. Howevere it's not possible to get this test to
# pass in Python3 and django 1.11
@unittest.skip("Bug in django 1.11 prevents this from working in python3. Re-enable after django 2.x upgrade.")
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
def test_export_course_stdout(self, store_type):
test_course_key = self.create_dummy_course(store_type)