INCR-458
Python3 Update Added absolute_import Updated Meta Class declaration method
This commit is contained in:
@@ -4,6 +4,8 @@ Course Goals Application Configuration
|
||||
Signal handlers are connected here.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Decorators for Mobile APIs.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import functools
|
||||
|
||||
from django.http import Http404
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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']:
|
||||
|
||||
Reference in New Issue
Block a user