From d859d2300ca399aa93c8dc1f9678c56157466eca Mon Sep 17 00:00:00 2001 From: Michael Youngstrom Date: Tue, 2 Apr 2019 14:39:19 -0400 Subject: [PATCH] INCR-190 --- .../schedules/migrations/0001_initial.py | 4 ++-- .../migrations/0002_auto_20170816_1532.py | 2 +- .../schedules/migrations/0003_scheduleconfig.py | 4 ++-- .../migrations/0004_auto_20170922_1428.py | 2 +- .../migrations/0005_auto_20171010_1722.py | 2 +- .../migrations/0006_scheduleexperience.py | 2 +- .../0007_scheduleconfig_hold_back_ratio.py | 2 +- .../core/djangoapps/schedules/tests/factories.py | 7 ++++++- .../schedules/tests/test_content_highlights.py | 15 ++++++++------- .../djangoapps/schedules/tests/test_resolvers.py | 7 ++++++- .../djangoapps/schedules/tests/test_signals.py | 7 +++++++ .../core/djangoapps/schedules/tests/test_tasks.py | 9 +++++++-- 12 files changed, 43 insertions(+), 20 deletions(-) diff --git a/openedx/core/djangoapps/schedules/migrations/0001_initial.py b/openedx/core/djangoapps/schedules/migrations/0001_initial.py index 9dd8cc2705..edf267ddb7 100644 --- a/openedx/core/djangoapps/schedules/migrations/0001_initial.py +++ b/openedx/core/djangoapps/schedules/migrations/0001_initial.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals -from django.db import migrations, models import django.utils.timezone import model_utils.fields +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/openedx/core/djangoapps/schedules/migrations/0002_auto_20170816_1532.py b/openedx/core/djangoapps/schedules/migrations/0002_auto_20170816_1532.py index 2b5b868f4b..a67dcc4803 100644 --- a/openedx/core/djangoapps/schedules/migrations/0002_auto_20170816_1532.py +++ b/openedx/core/djangoapps/schedules/migrations/0002_auto_20170816_1532.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models diff --git a/openedx/core/djangoapps/schedules/migrations/0003_scheduleconfig.py b/openedx/core/djangoapps/schedules/migrations/0003_scheduleconfig.py index 0bd24a3413..23addb18fb 100644 --- a/openedx/core/djangoapps/schedules/migrations/0003_scheduleconfig.py +++ b/openedx/core/djangoapps/schedules/migrations/0003_scheduleconfig.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals -from django.db import migrations, models import django.db.models.deletion from django.conf import settings +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/openedx/core/djangoapps/schedules/migrations/0004_auto_20170922_1428.py b/openedx/core/djangoapps/schedules/migrations/0004_auto_20170922_1428.py index f185696eda..41a1934e7c 100644 --- a/openedx/core/djangoapps/schedules/migrations/0004_auto_20170922_1428.py +++ b/openedx/core/djangoapps/schedules/migrations/0004_auto_20170922_1428.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models diff --git a/openedx/core/djangoapps/schedules/migrations/0005_auto_20171010_1722.py b/openedx/core/djangoapps/schedules/migrations/0005_auto_20171010_1722.py index 1f617874c9..8f22a88c69 100644 --- a/openedx/core/djangoapps/schedules/migrations/0005_auto_20171010_1722.py +++ b/openedx/core/djangoapps/schedules/migrations/0005_auto_20171010_1722.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models diff --git a/openedx/core/djangoapps/schedules/migrations/0006_scheduleexperience.py b/openedx/core/djangoapps/schedules/migrations/0006_scheduleexperience.py index 468ad1388b..6fe2e9ba3e 100644 --- a/openedx/core/djangoapps/schedules/migrations/0006_scheduleexperience.py +++ b/openedx/core/djangoapps/schedules/migrations/0006_scheduleexperience.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models diff --git a/openedx/core/djangoapps/schedules/migrations/0007_scheduleconfig_hold_back_ratio.py b/openedx/core/djangoapps/schedules/migrations/0007_scheduleconfig_hold_back_ratio.py index 41ee03d634..aa944c701b 100644 --- a/openedx/core/djangoapps/schedules/migrations/0007_scheduleconfig_hold_back_ratio.py +++ b/openedx/core/djangoapps/schedules/migrations/0007_scheduleconfig_hold_back_ratio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models diff --git a/openedx/core/djangoapps/schedules/tests/factories.py b/openedx/core/djangoapps/schedules/tests/factories.py index 981da04a8a..bb984a25a6 100644 --- a/openedx/core/djangoapps/schedules/tests/factories.py +++ b/openedx/core/djangoapps/schedules/tests/factories.py @@ -1,9 +1,14 @@ +""" +Factories for schedules tests +""" +from __future__ import absolute_import + import factory import pytz from openedx.core.djangoapps.schedules import models -from student.tests.factories import CourseEnrollmentFactory from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory +from student.tests.factories import CourseEnrollmentFactory class ScheduleExperienceFactory(factory.DjangoModelFactory): diff --git a/openedx/core/djangoapps/schedules/tests/test_content_highlights.py b/openedx/core/djangoapps/schedules/tests/test_content_highlights.py index 837aea5a85..51f2762b00 100644 --- a/openedx/core/djangoapps/schedules/tests/test_content_highlights.py +++ b/openedx/core/djangoapps/schedules/tests/test_content_highlights.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- -from openedx.core.djangoapps.schedules.config import COURSE_UPDATE_WAFFLE_FLAG -from openedx.core.djangoapps.schedules.content_highlights import get_week_highlights, course_has_highlights -from openedx.core.djangoapps.schedules.exceptions import CourseUpdateDoesNotExist -from openedx.core.djangolib.testing.utils import skip_unless_lms -from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag +from __future__ import absolute_import +from openedx.core.djangoapps.schedules.config import COURSE_UPDATE_WAFFLE_FLAG +from openedx.core.djangoapps.schedules.content_highlights import course_has_highlights, get_week_highlights +from openedx.core.djangoapps.schedules.exceptions import CourseUpdateDoesNotExist +from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag +from openedx.core.djangolib.testing.utils import skip_unless_lms +from student.models import CourseEnrollment +from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory -from student.tests.factories import UserFactory -from student.models import CourseEnrollment @skip_unless_lms diff --git a/openedx/core/djangoapps/schedules/tests/test_resolvers.py b/openedx/core/djangoapps/schedules/tests/test_resolvers.py index 6cca8dfd71..ed0687347f 100644 --- a/openedx/core/djangoapps/schedules/tests/test_resolvers.py +++ b/openedx/core/djangoapps/schedules/tests/test_resolvers.py @@ -1,3 +1,8 @@ +""" +Tests for schedules resolvers +""" +from __future__ import absolute_import + import datetime from unittest import skipUnless @@ -7,7 +12,7 @@ from mock import Mock from openedx.core.djangoapps.schedules.resolvers import BinnedSchedulesBaseResolver from openedx.core.djangoapps.schedules.tests.factories import ScheduleConfigFactory -from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory, SiteConfigurationFactory +from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory, SiteFactory from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms diff --git a/openedx/core/djangoapps/schedules/tests/test_signals.py b/openedx/core/djangoapps/schedules/tests/test_signals.py index 438c5ab93b..e5fe930268 100644 --- a/openedx/core/djangoapps/schedules/tests/test_signals.py +++ b/openedx/core/djangoapps/schedules/tests/test_signals.py @@ -1,4 +1,10 @@ +""" +Tests for schedules signals +""" +from __future__ import absolute_import + import datetime + import ddt import pytest from mock import patch @@ -17,6 +23,7 @@ from student.tests.factories import CourseEnrollmentFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory + from ..models import Schedule from ..tests.factories import ScheduleConfigFactory diff --git a/openedx/core/djangoapps/schedules/tests/test_tasks.py b/openedx/core/djangoapps/schedules/tests/test_tasks.py index cfb7095c5d..5b7fcacf7e 100644 --- a/openedx/core/djangoapps/schedules/tests/test_tasks.py +++ b/openedx/core/djangoapps/schedules/tests/test_tasks.py @@ -1,12 +1,17 @@ +""" +Tests for schedules tasks +""" +from __future__ import absolute_import + import datetime from unittest import skipUnless import ddt from django.conf import settings -from mock import patch, DEFAULT, Mock +from mock import DEFAULT, Mock, patch -from openedx.core.djangoapps.schedules.tasks import ScheduleMessageBaseTask from openedx.core.djangoapps.schedules.resolvers import DEFAULT_NUM_BINS +from openedx.core.djangoapps.schedules.tasks import ScheduleMessageBaseTask from openedx.core.djangoapps.schedules.tests.factories import ScheduleConfigFactory from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms