Skip to content

Commit

Permalink
clean up test
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-at-mit committed Aug 1, 2024
1 parent d657b5f commit 4b981ad
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions courses/serializers/v1/courses_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from cms.factories import CoursePageFactory, FlexiblePricingFormFactory
from cms.serializers import CoursePageSerializer
from courses.factories import (
CourseFactory,
CourseRunEnrollmentFactory,
CourseRunFactory,
CourseRunGradeFactory,
Expand Down Expand Up @@ -251,8 +252,7 @@ def test_serialize_course_required_prerequisites(
mocker, mock_context, prerequisites_cms_value, settings
):
"""Test Course serialization to ensure that required_prerequisites is set to True if prerequisites is defined in the CMS and no an empty string, otherwise False"""
courseRun1 = CourseRunFactory.create()
course = courseRun1.course
course = CourseFactory.create()
expected_required_prerequisites = False
if prerequisites_cms_value is not None:
# When prerequisites_cms_value is None, the course page has been created but prerequisites has never been populated.
Expand All @@ -269,10 +269,8 @@ def test_serialize_course_required_prerequisites(
"title": course.title,
"readable_id": course.readable_id,
"id": course.id,
"courseruns": [
CourseRunSerializer(courseRun1).data,
],
"next_run_id": course.first_unexpired_run.id,
"courseruns": [],
"next_run_id": None,
"departments": [],
"page": CoursePageSerializer(course.page).data,
"required_prerequisites": expected_required_prerequisites,
Expand Down

0 comments on commit 4b981ad

Please sign in to comment.