@@ -197,7 +197,7 @@ def test_generate_data_for_studio_api__external_course_enrollment_dates(self):
197197 exec_ed_type = CourseTypeFactory (slug = CourseType .EXECUTIVE_EDUCATION_2U )
198198 run = CourseRunFactory (course = CourseFactory (type = exec_ed_type ))
199199 with mock .patch ('course_discovery.apps.api.utils.logger' ) as mock_logger :
200- expected_data = self .make_studio_data (run , add_pacing = False , add_schedule = False , add_enrollment_dates = True )
200+ expected_data = self .make_studio_data (run , add_pacing = False , add_schedule = True , add_enrollment_dates = True )
201201 output_data = StudioAPI .generate_data_for_studio_api (run , False )
202202 assert output_data == expected_data
203203 mock_logger .info .assert_called_with (
@@ -211,14 +211,12 @@ def test_generate_data_for_studio_api__external_course_missing_enrollment_dates(
211211 exec_ed_type = CourseTypeFactory (slug = CourseType .EXECUTIVE_EDUCATION_2U )
212212 run = CourseRunFactory (course = CourseFactory (type = exec_ed_type ), enrollment_start = None , enrollment_end = None )
213213 with mock .patch ('course_discovery.apps.api.utils.logger' ) as mock_logger :
214- expected_data = self .make_studio_data (run , add_pacing = False , add_schedule = False )
214+ expected_data = self .make_studio_data (run , add_pacing = False , add_schedule = True , add_enrollment_dates = False )
215215 output_data = StudioAPI .generate_data_for_studio_api (run , False )
216216 assert output_data == expected_data
217217
218218 with self .assertRaises (AssertionError ):
219- mock_logger .info .assert_called_with (
220- f'Enrollment information added to data { output_data } for course run { run .key } '
221- )
219+ mock_logger .info .assert_called ()
222220
223221 def test_generate_data_for_studio_api__non_external_course_no_start_end_on_update (self ):
224222 """Test that start/end are NOT included when updating a non-external course."""
@@ -235,13 +233,10 @@ def test_generate_data_for_studio_api__external_course_start_end_on_update(self)
235233 """Test that start/end are included for external course on update."""
236234 exec_ed_type = CourseTypeFactory (slug = CourseType .EXECUTIVE_EDUCATION_2U )
237235 run = CourseRunFactory (course = CourseFactory (type = exec_ed_type ))
238-
239236 expected_data = self .make_studio_data (run , add_pacing = False , add_schedule = True , add_enrollment_dates = True )
240-
241237 with mock .patch ('course_discovery.apps.api.utils.logger' ) as mock_logger :
242238 output_data = StudioAPI .generate_data_for_studio_api (run , creating = False )
243239 self .assertEqual (output_data , expected_data )
244-
245240 mock_logger .info .assert_called_with (
246241 f'Enrollment information added to data { output_data } for course run { run .key } '
247242 )
0 commit comments