Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenni Whitman committed Oct 31, 2023
1 parent ed3b13c commit 90b4144
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 14 deletions.
8 changes: 6 additions & 2 deletions courses/serializers/v1/courses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -143,4 +148,3 @@ class Meta(BaseCourseRunEnrollmentSerializer.Meta):
fields = BaseCourseRunEnrollmentSerializer.Meta.fields + [
"run_id",
]

15 changes: 12 additions & 3 deletions courses/serializers/v1/courses_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 12 additions & 3 deletions courses/serializers/v1/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 15 additions & 3 deletions courses/serializers/v1/programs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
5 changes: 4 additions & 1 deletion courses/serializers/v2/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
5 changes: 4 additions & 1 deletion courses/serializers/v2/programs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion courses/views/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90b4144

Please sign in to comment.