INCR-243: Make compatible with Python 3.x without breaking Python 2.7 support for openedx/core/djangoapps/models openedx/core/djangoapps/debug (#20532)

This commit is contained in:
Amit
2019-05-13 16:29:07 +03:00
committed by Michael Youngstrom
parent cceb3f1b67
commit 3a1c68fb30
3 changed files with 12 additions and 6 deletions

View File

@@ -3,10 +3,13 @@ Views that are only activated when the project is running in development mode.
These views will NOT be shown on production: trying to access them will result
in a 404 error.
"""
from __future__ import absolute_import
import bleach
from django.http import HttpResponseNotFound
from django.template import TemplateDoesNotExist
from django.utils.translation import ugettext as _
from edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.util.user_messages import PageLevelMessages

View File

@@ -1,17 +1,18 @@
"""
CourseDetails
"""
import re
from __future__ import absolute_import
import logging
import re
from django.conf import settings
from xmodule.fields import Date
from xmodule.modulestore.exceptions import ItemNotFoundError
from openedx.core.djangolib.markup import HTML
from openedx.core.lib.courses import course_image_url
from xmodule.fields import Date
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
# This list represents the attribute keys for a course's 'about' info.
# Note: The 'video' attribute is intentionally excluded as it must be

View File

@@ -2,16 +2,18 @@
Tests for CourseDetails
"""
from __future__ import absolute_import
import datetime
import ddt
from pytz import UTC
from openedx.core.djangoapps.models.course_details import ABOUT_ATTRIBUTES, CourseDetails
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from openedx.core.djangoapps.models.course_details import CourseDetails, ABOUT_ATTRIBUTES
@ddt.ddt
class CourseDetailsTestCase(ModuleStoreTestCase):