from course_modes.models import CourseMode from course_modes.tests.factories import CourseModeFactory def test_course_mode_is_active(): # Create a new course mode with the active flag set to True course_mode = CourseModeFactory(active=True) # Test that the course mode is indeed active assert course_mode.active def test_course_mode_default_values(): # Create a new course mode using only the defaults for all attributes course_mode = CourseModeFactory() # Test that the default values are as expected assert course_mode.mode_slug == 'honor' assert course_mode.description == '' assert not course_mode.activeIn the first example, we create a new `CourseMode` instance using `CourseModeFactory()` with the `active` attribute set to `True`. We then use an `assert` statement to confirm that the `active` flag was indeed set correctly. In the second example, we create a new `CourseMode` instance using only the default attribute values in the factory. We use `assert` statements to confirm that the default values are what we expect them to be. Overall, the `CourseModeFactory` is a useful testing tool for verifying the behavior of `CourseMode` instances in the edX platform.