def test_transmit_course_metadata_task_no_catalog(self):
"""
Test the data transmission task with enterprise customer that has no course catalog.
"""
uuid = str(self.enterprise_customer.uuid)
course_run_ids = ['course-v1:edX+DemoX+Demo_Course']
self.mock_ent_courses_api_with_pagination(
enterprise_uuid=uuid,
course_run_ids=course_run_ids
)
integrated_channel_enterprise = self.sapsf.enterprise_customer
integrated_channel_enterprise.catalog = None
integrated_channel_enterprise.save()
with LogCapture(level=logging.INFO) as log_capture:
call_command('transmit_course_metadata', '--catalog_user', self.user.username)
# Because there are no EnterpriseCustomers with a catalog, the process will end early.
assert not log_capture.records
评论列表
文章目录