Skip to content
Snippets Groups Projects
Commit ea8a197e authored by Ayub khan's avatar Ayub khan
Browse files

INCR-427 python3 compatibility

parent fa693d1a
No related branches found
No related tags found
No related merge requests found
import os
"""
Envirement Setup for fixtures.
"""
from __future__ import absolute_import
import os
HOSTNAME = os.environ.get('BOK_CHOY_HOSTNAME', 'localhost')
CMS_PORT = os.environ.get('BOK_CHOY_CMS_PORT', '8031')
......
"""
Common code shared by course and library fixtures.
"""
from __future__ import absolute_import
import json
import requests
import six
from lazy import lazy
from common.test.acceptance.fixtures import STUDIO_BASE_URL
......@@ -164,7 +167,7 @@ class XBlockContainerFixture(StudioApiFixture):
Encode `post_dict` (a dictionary) as UTF-8 encoded JSON.
"""
return json.dumps({
k: v.encode('utf-8') if isinstance(v, basestring) else v
k: v.encode('utf-8') if isinstance(v, six.string_types) else v
for k, v in post_dict.items()
})
......
"""
Tools to create catalog-related data for use in bok choy tests.
"""
from __future__ import absolute_import
import json
import requests
......
......@@ -2,6 +2,8 @@
Tools for creating certificates config fixture data.
"""
from __future__ import absolute_import
import json
from common.test.acceptance.fixtures import STUDIO_BASE_URL
......
......@@ -2,12 +2,15 @@
Fixture to create a course and course components (XBlocks).
"""
from __future__ import absolute_import
import datetime
import json
import mimetypes
from collections import namedtuple
from textwrap import dedent
import six
from opaque_keys.edx.keys import CourseKey
from path import Path
......@@ -255,7 +258,7 @@ class CourseFixture(XBlockContainerFixture):
block_id = self._course_dict['run']
else:
block_id = 'course'
return unicode(course_key.make_usage_key('course', block_id))
return six.text_type(course_key.make_usage_key('course', block_id))
@property
def _assets_url(self):
......@@ -270,7 +273,7 @@ class CourseFixture(XBlockContainerFixture):
Return the locator string for the course handouts
"""
course_key = CourseKey.from_string(self._course_key)
return unicode(course_key.make_usage_key('course_info', 'handouts'))
return six.text_type(course_key.make_usage_key('course_info', 'handouts'))
def _create_course(self):
"""
......
......@@ -2,6 +2,8 @@
Tools for creating edxnotes content fixture data.
"""
from __future__ import absolute_import
import json
import factory
......
......@@ -2,6 +2,9 @@
Fixture to create a Content Library
"""
from __future__ import absolute_import
import six
from opaque_keys.edx.keys import CourseKey
from common.test.acceptance.fixtures import STUDIO_BASE_URL
......@@ -62,7 +65,7 @@ class LibraryFixture(XBlockContainerFixture):
Return the locator string for the LibraryRoot XBlock that is the root of the library hierarchy.
"""
lib_key = CourseKey.from_string(self._library_key)
return unicode(lib_key.make_usage_key('library', 'library'))
return six.text_type(lib_key.make_usage_key('library', 'library'))
def _create_library(self):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment