Merge pull request #21076 from edx/INCR-414
INCR-414 python3 compatibility
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
"""
|
||||
Package declaration for content assertions test helper module
|
||||
"""
|
||||
import core
|
||||
from __future__ import absolute_import
|
||||
|
||||
from . import core
|
||||
|
||||
@@ -35,9 +35,10 @@ The functions are of the form:
|
||||
A further extension would be to provide a companion set of functions that
|
||||
resources that are provided to the Fragment
|
||||
"""
|
||||
import lxml.html
|
||||
import lxml.etree
|
||||
from __future__ import absolute_import
|
||||
|
||||
import lxml.etree
|
||||
import lxml.html
|
||||
from singledispatch import singledispatch
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
"""Module annotatable tests"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
from lxml import etree
|
||||
from mock import Mock
|
||||
|
||||
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
|
||||
from xblock.field_data import DictFieldData
|
||||
from xblock.fields import ScopeIds
|
||||
|
||||
from xmodule.annotatable_module import AnnotatableModule
|
||||
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
|
||||
|
||||
from . import get_test_system
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import ddt
|
||||
from __future__ import absolute_import
|
||||
|
||||
import itertools
|
||||
from xmodule.tests import BulkAssertionTest, BulkAssertionError
|
||||
|
||||
import ddt
|
||||
|
||||
from xmodule.tests import BulkAssertionError, BulkAssertionTest
|
||||
|
||||
ASSERTION_METHODS_DICT = {
|
||||
"GETITEM_SPECIAL_METHOD": {}.__getitem__,
|
||||
|
||||
@@ -1,32 +1,34 @@
|
||||
"""
|
||||
Tests for course_metadata_utils.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from collections import namedtuple
|
||||
from datetime import timedelta, datetime
|
||||
from datetime import datetime, timedelta
|
||||
from unittest import TestCase
|
||||
|
||||
from pytz import utc
|
||||
|
||||
from xmodule.block_metadata_utils import (
|
||||
url_name_for_block,
|
||||
display_name_with_default,
|
||||
display_name_with_default_escaped,
|
||||
url_name_for_block
|
||||
)
|
||||
from xmodule.course_metadata_utils import (
|
||||
clean_course_key,
|
||||
number_for_course_location,
|
||||
has_course_started,
|
||||
has_course_ended,
|
||||
DEFAULT_START_DATE,
|
||||
clean_course_key,
|
||||
course_start_date_is_default,
|
||||
has_course_ended,
|
||||
has_course_started,
|
||||
may_certify_for_course,
|
||||
number_for_course_location
|
||||
)
|
||||
from xmodule.modulestore.tests.utils import (
|
||||
MixedModulestoreBuilder,
|
||||
MongoModulestoreBuilder,
|
||||
VersioningModulestoreBuilder,
|
||||
MixedModulestoreBuilder
|
||||
VersioningModulestoreBuilder
|
||||
)
|
||||
|
||||
|
||||
_TODAY = datetime.now(utc)
|
||||
_LAST_MONTH = _TODAY - timedelta(days=30)
|
||||
_LAST_WEEK = _TODAY - timedelta(days=7)
|
||||
|
||||
@@ -1,35 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import datetime
|
||||
from tempfile import mkdtemp
|
||||
|
||||
import ddt
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from fs.osfs import OSFS
|
||||
from lxml import etree
|
||||
from mock import Mock, patch
|
||||
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
|
||||
from pytz import UTC
|
||||
from six import text_type
|
||||
|
||||
from xmodule.xml_module import is_pointer_tag
|
||||
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
|
||||
from xmodule.modulestore import only_xmodules
|
||||
from xmodule.modulestore.xml import ImportSystem, XMLModuleStore, LibraryXMLModuleStore
|
||||
from xmodule.modulestore.inheritance import compute_inherited_metadata
|
||||
from xmodule.x_module import XModuleMixin
|
||||
from xmodule.fields import Date
|
||||
from xmodule.tests import DATA_DIR
|
||||
from xmodule.modulestore.inheritance import InheritanceMixin
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
|
||||
from xblock.core import XBlock
|
||||
from xblock.fields import Scope, String, Integer
|
||||
from xblock.runtime import KvsFieldData, DictKeyValueStore
|
||||
from xblock.fields import Integer, Scope, String
|
||||
from xblock.runtime import DictKeyValueStore, KvsFieldData
|
||||
|
||||
from xmodule.fields import Date
|
||||
from xmodule.modulestore import only_xmodules
|
||||
from xmodule.modulestore.inheritance import InheritanceMixin, compute_inherited_metadata
|
||||
from xmodule.modulestore.xml import ImportSystem, LibraryXMLModuleStore, XMLModuleStore
|
||||
from xmodule.tests import DATA_DIR
|
||||
from xmodule.x_module import XModuleMixin
|
||||
from xmodule.xml_module import is_pointer_tag
|
||||
|
||||
ORG = 'test_org'
|
||||
COURSE = 'test_course'
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Test for Poll Xmodule functional logic."""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from mock import Mock
|
||||
|
||||
from xmodule.poll_module import PollDescriptor
|
||||
|
||||
from . import LogicTest
|
||||
from .test_import import DummySystem
|
||||
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
Tests for SettingsService
|
||||
"""
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from __future__ import absolute_import
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from config_models.models import ConfigurationModel
|
||||
from django.conf import settings
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from xblock.runtime import Mixologist
|
||||
|
||||
from xmodule.services import ConfigurationService, SettingsService
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
"""
|
||||
Tests stringify functions used in xmodule html
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from xmodule.stringify import stringify_children
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
"""
|
||||
Tests for extended due date utilities.
|
||||
"""
|
||||
import mock
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
|
||||
from ..util import duedate
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user