'Dry method to update the enrollment and assert response.'

def assert_update_enrollment(self, search_string_type, new_mode):

    self.assertIsNone(ManualEnrollmentAudit.get_manual_enrollment_by_email(self.student.email))
    url = reverse('support:enrollment_list', kwargs={'username_or_email': getattr(self.student, search_string_type)})
    response = self.client.post(url, data={'course_id': unicode(self.course.id), 'old_mode': CourseMode.AUDIT, 'new_mode': new_mode, 'reason': 'Financial    Assistance'})
    if (new_mode == CourseMode.CREDIT_MODE):
        self.assertEqual(response.status_code, 400)
    else:
        self.assertEqual(response.status_code, 200)
        self.assertIsNotNone(ManualEnrollmentAudit.get_manual_enrollment_by_email(self.student.email))
        self.assert_enrollment(new_mode)
