diff --git a/lms/djangoapps/course_goals/apps.py b/lms/djangoapps/course_goals/apps.py index 122889be64..8296753131 100644 --- a/lms/djangoapps/course_goals/apps.py +++ b/lms/djangoapps/course_goals/apps.py @@ -4,6 +4,8 @@ Course Goals Application Configuration Signal handlers are connected here. """ +from __future__ import absolute_import + from django.apps import AppConfig diff --git a/lms/djangoapps/mobile_api/admin.py b/lms/djangoapps/mobile_api/admin.py index 3a7c5f5862..f136dccb3b 100644 --- a/lms/djangoapps/mobile_api/admin.py +++ b/lms/djangoapps/mobile_api/admin.py @@ -2,6 +2,8 @@ Django admin dashboard configuration for LMS XBlock infrastructure. """ +from __future__ import absolute_import + from config_models.admin import ConfigurationModelAdmin from django.contrib import admin diff --git a/lms/djangoapps/mobile_api/context_processor.py b/lms/djangoapps/mobile_api/context_processor.py index 32c5adf876..6d379bdf6c 100644 --- a/lms/djangoapps/mobile_api/context_processor.py +++ b/lms/djangoapps/mobile_api/context_processor.py @@ -2,6 +2,8 @@ Django template context processors. """ +from __future__ import absolute_import + from openedx.core.lib.mobile_utils import is_request_from_mobile_app diff --git a/lms/djangoapps/mobile_api/decorators.py b/lms/djangoapps/mobile_api/decorators.py index 5adda15c79..bbe18ea6b5 100644 --- a/lms/djangoapps/mobile_api/decorators.py +++ b/lms/djangoapps/mobile_api/decorators.py @@ -1,6 +1,8 @@ """ Decorators for Mobile APIs. """ +from __future__ import absolute_import + import functools from django.http import Http404 diff --git a/lms/djangoapps/mobile_api/mobile_platform.py b/lms/djangoapps/mobile_api/mobile_platform.py index 554efe8049..4fac4e24a0 100644 --- a/lms/djangoapps/mobile_api/mobile_platform.py +++ b/lms/djangoapps/mobile_api/mobile_platform.py @@ -1,16 +1,19 @@ """ Platform related Operations for Mobile APP """ +from __future__ import absolute_import + import abc import re +import six -class MobilePlatform: + +class MobilePlatform(six.with_metaclass(abc.ABCMeta)): """ MobilePlatform class creates an instance of platform based on user agent and supports platform related operations. """ - __metaclass__ = abc.ABCMeta version = None def __init__(self, version): diff --git a/lms/djangoapps/mobile_api/testutils.py b/lms/djangoapps/mobile_api/testutils.py index 3459bdbf78..e056d5035b 100644 --- a/lms/djangoapps/mobile_api/testutils.py +++ b/lms/djangoapps/mobile_api/testutils.py @@ -11,14 +11,18 @@ Test utilities for mobile API tests: """ # pylint: disable=no-member -import ddt +from __future__ import absolute_import + import datetime + +import ddt +import pytz +import six from django.conf import settings from django.urls import reverse from django.utils import timezone from mock import patch from opaque_keys.edx.keys import CourseKey -import pytz from rest_framework.test import APITestCase from courseware.access_response import MobileAvailabilityError, StartDateError, VisibilityError @@ -93,7 +97,7 @@ class MobileAPITestCase(ModuleStoreTestCase, APITestCase): """Base implementation that returns URL for endpoint that's being tested.""" reverse_args = reverse_args or {} if 'course_id' in self.REVERSE_INFO['params']: - reverse_args.update({'course_id': unicode(kwargs.get('course_id', self.course.id))}) + reverse_args.update({'course_id': six.text_type(kwargs.get('course_id', self.course.id))}) if 'username' in self.REVERSE_INFO['params']: reverse_args.update({'username': kwargs.get('username', self.user.username)}) if 'api_version' in self.REVERSE_INFO['params']: