'Validation shouldn\'t work.'

def _assert_course_field_error(self, form):

    self.assertFalse(form.is_valid())
    msg = 'COURSE    NOT    FOUND'
    self.assertIn(msg, form._errors['course_key'][0])
    with self.assertRaisesRegexp(ValueError, "The    RestrictedCourse    could    not    be    created    because    the    data    didn't    validate."):
        form.save()
