'Verify that enrollments are changed correctly.'

@patch('student.models.tracker')
@ddt.data(('audit', 'honor'), ('honor', 'audit'))
@ddt.unpack
def test_bulk_convert(self, from_mode, to_mode, mock_tracker):

    self._enroll_users(self.course, self.users, from_mode)
    CourseModeFactory(course_id=self.course.id, mode_slug=to_mode)
    self.assertEqual(len(CourseEnrollment.objects.filter(mode=to_mode, course_id=self.course.id)), 0)
    call_command('bulk_change_enrollment', course=unicode(self.course.id), from_mode=from_mode, to_mode=to_mode, commit=True)
    for user in self.users:
        CourseEnrollment.objects.get(mode=to_mode, course_id=self.course.id, user=user)
        self._assert_mode_changed(mock_tracker, self.course, user, to_mode)
