Merge pull request #21301 from edx/feanil/fix_test_collection

Fix some test collection in python 3.
This commit is contained in:
Feanil Patel
2019-08-07 10:12:10 -04:00
committed by GitHub
3 changed files with 3 additions and 5 deletions

View File

@@ -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

View File

@@ -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,

View File

@@ -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)