INCR-129: Run python-modernize on common/djangoapps/entitlements/management and tests (#20446)

* INCR-129: Run python-modernize on common/djangoapps/entitlements/management

* isort

* INCR-129: Run python-modernize on common/djangoapps/entitlements/tests

* isort
This commit is contained in:
Anthony Wee
2019-05-07 09:52:09 -07:00
committed by Michael Youngstrom
parent 6057527689
commit 2d8dfa895f
6 changed files with 22 additions and 10 deletions

View File

@@ -2,9 +2,12 @@
Management command for expiring old entitlements.
"""
from __future__ import absolute_import
import logging
from django.core.management import BaseCommand
from six.moves import range
from entitlements.models import CourseEntitlement
from entitlements.tasks import expire_old_entitlements

View File

@@ -1,12 +1,14 @@
"""Test Entitlements models"""
import mock
from __future__ import absolute_import
import mock
from django.core.management import call_command
from django.test import TestCase
from six.moves import range
from openedx.core.djangolib.testing.utils import skip_unless_lms
from entitlements.tests.factories import CourseEntitlementFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
@skip_unless_lms

View File

@@ -1,10 +1,11 @@
from __future__ import absolute_import
import string
from uuid import uuid4
import factory
from factory.fuzzy import FuzzyChoice, FuzzyText
from student.tests.factories import UserFactory
from course_modes.helpers import CourseMode
from entitlements.models import CourseEntitlement, CourseEntitlementPolicy
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory

View File

@@ -1,5 +1,7 @@
"""Test Entitlements models"""
from __future__ import absolute_import
import unittest
from datetime import timedelta
from uuid import uuid4
@@ -8,8 +10,6 @@ from django.conf import settings
from django.test import TestCase
from django.utils.timezone import now
from mock import patch
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from course_modes.models import CourseMode
from course_modes.tests.factories import CourseModeFactory
@@ -18,7 +18,9 @@ from lms.djangoapps.certificates.models import CertificateStatuses
from lms.djangoapps.certificates.tests.factories import GeneratedCertificateFactory
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from student.models import CourseEnrollment
from student.tests.factories import (TEST_PASSWORD, CourseEnrollmentFactory, UserFactory)
from student.tests.factories import TEST_PASSWORD, CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
# Entitlements is not in CMS' INSTALLED_APPS so these imports will error during test collection
if settings.ROOT_URLCONF == 'lms.urls':

View File

@@ -2,10 +2,12 @@
Test entitlements tasks
"""
from __future__ import absolute_import
from datetime import datetime, timedelta
import mock
import pytz
from django.test import TestCase
from entitlements import tasks

View File

@@ -2,17 +2,19 @@
Test entitlements utilities
"""
from __future__ import absolute_import
from datetime import timedelta
from opaque_keys.edx.keys import CourseKey
from django.conf import settings
from django.utils.timezone import now
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from opaque_keys.edx.keys import CourseKey
from course_modes.models import CourseMode
from course_modes.tests.factories import CourseModeFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
from student.tests.factories import (TEST_PASSWORD, UserFactory, CourseOverviewFactory, CourseEnrollmentFactory)
from student.tests.factories import TEST_PASSWORD, CourseEnrollmentFactory, CourseOverviewFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
# Entitlements is not in CMS' INSTALLED_APPS so these imports will error during test collection
if settings.ROOT_URLCONF == 'lms.urls':