'Ensures an enrollment mode change event was emitted'

def assert_enrollment_mode_change_event_was_emitted(self, user, course_key, mode):

    self.mock_tracker.emit.assert_called_once_with('edx.course.enrollment.mode_changed', {'course_id': course_key.to_deprecated_string(), 'user_id': user.pk, 'mode': mode})
    self.mock_tracker.reset_mock()
