'Confirm the analytics event was emitted.'

def _assert_mode_changed(self, mock_tracker, course, user, to_mode):

    mock_tracker.emit.assert_has_calls([call(EVENT_NAME_ENROLLMENT_MODE_CHANGED, {'course_id': unicode(course.id), 'user_id': user.id, 'mode': to_mode})])
