diff --git a/courses/serializers/v1/courses.py b/courses/serializers/v1/courses.py index 296ab738ca..aa087b7b3c 100644 --- a/courses/serializers/v1/courses.py +++ b/courses/serializers/v1/courses.py @@ -4,7 +4,12 @@ from cms.serializers import CoursePageSerializer from courses import models from courses.api import create_run_enrollments -from courses.serializers.v1.base import BaseCourseSerializer, BaseCourseRunEnrollmentSerializer, BaseCourseRunSerializer, ProductRelatedField +from courses.serializers.v1.base import ( + BaseCourseSerializer, + BaseCourseRunEnrollmentSerializer, + BaseCourseRunSerializer, + ProductRelatedField, +) from courses.serializers.v1.departments import DepartmentSerializer from flexiblepricing.api import is_courseware_flexible_price_approved from main import features @@ -143,4 +148,3 @@ class Meta(BaseCourseRunEnrollmentSerializer.Meta): fields = BaseCourseRunEnrollmentSerializer.Meta.fields + [ "run_id", ] - diff --git a/courses/serializers/v1/courses_test.py b/courses/serializers/v1/courses_test.py index 03461a8ef7..8d77e9f242 100644 --- a/courses/serializers/v1/courses_test.py +++ b/courses/serializers/v1/courses_test.py @@ -4,11 +4,20 @@ from cms.factories import FlexiblePricingFormFactory, CoursePageFactory from cms.serializers import CoursePageSerializer -from courses.factories import CourseRunFactory, CourseRunEnrollmentFactory, CourseRunGradeFactory +from courses.factories import ( + CourseRunFactory, + CourseRunEnrollmentFactory, + CourseRunGradeFactory, +) from courses.models import Department from courses.serializers.v1.base import BaseCourseSerializer, CourseRunGradeSerializer -from courses.serializers.v1.courses import CourseRunSerializer, CourseWithCourseRunsSerializer, CourseSerializer, \ - CourseRunWithCourseSerializer, CourseRunEnrollmentSerializer +from courses.serializers.v1.courses import ( + CourseRunSerializer, + CourseWithCourseRunsSerializer, + CourseSerializer, + CourseRunWithCourseSerializer, + CourseRunEnrollmentSerializer, +) from courses.serializers.v1.programs import ProgramSerializer from ecommerce.serializers import BaseProductSerializer from flexiblepricing.constants import FlexiblePriceStatus diff --git a/courses/serializers/v1/programs.py b/courses/serializers/v1/programs.py index 96ffb0cf64..20b4791e62 100644 --- a/courses/serializers/v1/programs.py +++ b/courses/serializers/v1/programs.py @@ -6,10 +6,19 @@ from cms.serializers import ProgramPageSerializer from courses import models -from courses.serializers.base import get_thumbnail_url, BaseProgramRequirementTreeSerializer +from courses.serializers.base import ( + get_thumbnail_url, + BaseProgramRequirementTreeSerializer, +) from courses.serializers.v1.departments import DepartmentSerializer -from courses.serializers.v1.courses import CourseWithCourseRunsSerializer, CourseRunEnrollmentSerializer -from courses.serializers.v1.base import CourseRunCertificateSerializer, CourseRunGradeSerializer +from courses.serializers.v1.courses import ( + CourseWithCourseRunsSerializer, + CourseRunEnrollmentSerializer, +) +from courses.serializers.v1.base import ( + CourseRunCertificateSerializer, + CourseRunGradeSerializer, +) from main.serializers import StrictFieldsSerializer from openedx.constants import EDX_ENROLLMENT_VERIFIED_MODE from users.models import User diff --git a/courses/serializers/v1/programs_test.py b/courses/serializers/v1/programs_test.py index a6c8467d8c..d52cd69cc1 100644 --- a/courses/serializers/v1/programs_test.py +++ b/courses/serializers/v1/programs_test.py @@ -6,16 +6,28 @@ from mitol.common.utils import now_in_utc from cms.serializers import ProgramPageSerializer -from courses.factories import CourseRunFactory, ProgramFactory, CourseFactory, CourseRunEnrollmentFactory, \ - CourseRunGradeFactory, program_with_empty_requirements +from courses.factories import ( + CourseRunFactory, + ProgramFactory, + CourseFactory, + CourseRunEnrollmentFactory, + CourseRunGradeFactory, + program_with_empty_requirements, +) from courses.models import Department, ProgramRequirementNodeType, ProgramRequirement from courses.serializers.v1.courses import CourseWithCourseRunsSerializer -from courses.serializers.v1.programs import ProgramSerializer, LearnerRecordSerializer, ProgramRequirementSerializer, ProgramRequirementTreeSerializer +from courses.serializers.v1.programs import ( + ProgramSerializer, + LearnerRecordSerializer, + ProgramRequirementSerializer, + ProgramRequirementTreeSerializer, +) from main.test_utils import assert_drf_json_equal from openedx.constants import EDX_ENROLLMENT_VERIFIED_MODE, EDX_ENROLLMENT_AUDIT_MODE pytestmark = [pytest.mark.django_db] + @pytest.mark.parametrize( "remove_tree", [True, False], diff --git a/courses/serializers/v2/programs.py b/courses/serializers/v2/programs.py index fcd5fdcfc2..3584fa8053 100644 --- a/courses/serializers/v2/programs.py +++ b/courses/serializers/v2/programs.py @@ -4,7 +4,10 @@ from cms.serializers import ProgramPageSerializer from courses.models import Program, ProgramRequirementNodeType -from courses.serializers.base import get_thumbnail_url, BaseProgramRequirementTreeSerializer +from courses.serializers.base import ( + get_thumbnail_url, + BaseProgramRequirementTreeSerializer, +) from main.serializers import StrictFieldsSerializer logger = logging.getLogger(__name__) diff --git a/courses/serializers/v2/programs_test.py b/courses/serializers/v2/programs_test.py index bb5b788151..ff66d44283 100644 --- a/courses/serializers/v2/programs_test.py +++ b/courses/serializers/v2/programs_test.py @@ -6,7 +6,10 @@ from cms.serializers import ProgramPageSerializer from courses.factories import CourseRunFactory, program_with_empty_requirements from courses.models import Department -from courses.serializers.v2.programs import ProgramSerializer, ProgramRequirementTreeSerializer +from courses.serializers.v2.programs import ( + ProgramSerializer, + ProgramRequirementTreeSerializer, +) from main.test_utils import assert_drf_json_equal pytestmark = [pytest.mark.django_db] diff --git a/courses/views/v1/__init__.py b/courses/views/v1/__init__.py index 07e036dacb..22e3840a43 100644 --- a/courses/views/v1/__init__.py +++ b/courses/views/v1/__init__.py @@ -45,7 +45,10 @@ PartnerSchoolSerializer, ProgramSerializer, ) -from courses.serializers.v1.programs import UserProgramEnrollmentDetailSerializer, LearnerRecordSerializer +from courses.serializers.v1.programs import ( + UserProgramEnrollmentDetailSerializer, + LearnerRecordSerializer, +) from courses.serializers.v1.departments import DepartmentWithCountSerializer from courses.tasks import send_partner_school_email from courses.utils import get_program_certificate_by_enrollment