From 21fd145ab904fd8b1fc9f0fa748e1032eff8c238 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 6 Aug 2019 14:56:57 -0400 Subject: [PATCH 1/2] Use relative import for content store reference. The full import path was having issues in python 3 complaining that it couldn't find the module. --- cms/djangoapps/contentstore/views/assets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/views/assets.py b/cms/djangoapps/contentstore/views/assets.py index c4a6980981..8a8780f41a 100644 --- a/cms/djangoapps/contentstore/views/assets.py +++ b/cms/djangoapps/contentstore/views/assets.py @@ -19,7 +19,7 @@ from opaque_keys.edx.keys import AssetKey, CourseKey from pymongo import ASCENDING, DESCENDING from six import text_type -from contentstore.utils import reverse_course_url +from ..utils import reverse_course_url from contentstore.views.exception import AssetNotFoundException, AssetSizeTooLargeException from edxmako.shortcuts import render_to_response from openedx.core.djangoapps.contentserver.caching import del_cached_content From 18e988b747625dd7096f0ecacae2599a2286cfc2 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 6 Aug 2019 15:19:55 -0400 Subject: [PATCH 2/2] Fix some minor issues that prevent some tests from being collected. --- cms/djangoapps/contentstore/views/tests/test_videos.py | 3 +-- common/lib/xmodule/xmodule/modulestore/split_mongo/split.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cms/djangoapps/contentstore/views/tests/test_videos.py b/cms/djangoapps/contentstore/views/tests/test_videos.py index 9ac5bddf8e..9d142adbb4 100644 --- a/cms/djangoapps/contentstore/views/tests/test_videos.py +++ b/cms/djangoapps/contentstore/views/tests/test_videos.py @@ -10,7 +10,6 @@ import re from contextlib import contextmanager from datetime import datetime from functools import wraps -from StringIO import StringIO import dateutil.parser import ddt @@ -1417,7 +1416,7 @@ class VideoUrlsCsvTestCase(VideoUploadTestMixin, CourseTestCase): response["Content-Disposition"], u"attachment; filename={course}_video_urls.csv".format(course=self.course.id.course) ) - response_reader = StringIO(response.content) + response_reader = six.StringIO(response.content) reader = csv.DictReader(response_reader, dialect=csv.excel) self.assertEqual( reader.fieldnames, diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py index 4531ebd67c..77eea07e6c 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py @@ -61,7 +61,6 @@ import hashlib import logging from collections import defaultdict from importlib import import_module -from types import NoneType import six from bson.objectid import ObjectId @@ -2108,7 +2107,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase): Broke out guts of update_item for short-circuited internal use only """ with self.bulk_operations(course_key): - if allow_not_found and isinstance(block_key.id, (LocalId, NoneType)): + if allow_not_found and isinstance(block_key.id, (LocalId, type(None))): fields = {} for subfields in six.itervalues(partitioned_fields): fields.update(subfields)