* INCR-239: Run python-modernize and isort on openedx/core/djangoapps/programs [tests, tasks]

* INCR-239: Grouped six package and represent unused variables with _
This commit is contained in:
Amit
2019-05-10 19:35:41 +03:00
committed by Michael Youngstrom
parent eb0f52d110
commit fd7527e136
7 changed files with 51 additions and 35 deletions

View File

@@ -1,6 +1,8 @@
"""
This file contains celery tasks for programs-related functionality.
"""
from __future__ import absolute_import
from celery import task
from celery.exceptions import MaxRetriesExceededError
from celery.utils.log import get_task_logger
@@ -16,8 +18,8 @@ from openedx.core.djangoapps.certificates.api import available_date_for_certific
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.core.djangoapps.credentials.models import CredentialsApiConfig
from openedx.core.djangoapps.credentials.utils import get_credentials, get_credentials_api_client
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.programs.utils import ProgramProgressMeter
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
LOGGER = get_task_logger(__name__)
# Under cms the following setting is not defined, leading to errors during tests.

View File

@@ -1,20 +1,23 @@
"""
Tests for programs celery tasks.
"""
from __future__ import absolute_import
import json
import logging
from datetime import datetime, timedelta
import ddt
import httpretty
import mock
import pytz
from waffle.testutils import override_switch
from celery.exceptions import MaxRetriesExceededError
from django.conf import settings
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings
from edx_oauth2_provider.tests.factories import ClientFactory
from edx_rest_api_client import exceptions
from edx_rest_api_client.client import EdxRestApiClient
from waffle.testutils import override_switch
from lms.djangoapps.certificates.tests.factories import GeneratedCertificateFactory
from openedx.core.djangoapps.catalog.tests.mixins import CatalogIntegrationMixin
@@ -22,7 +25,7 @@ from openedx.core.djangoapps.certificates.config import waffle
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin
from openedx.core.djangoapps.programs.tasks.v1 import tasks
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 skip_unless_lms
from student.tests.factories import UserFactory