Esempio n. 1
0
 def test_form_validation_success(self):
     form_data = {
         'course_key': unicode(self.course.id),
         'verified_cohort_name': 'Verified Learners',
         'enabled': True
     }
     form = VerifiedTrackCourseForm(data=form_data)
     self.assertTrue(form.is_valid())
Esempio n. 2
0
    def test_form_validation_failure(self):
        form_data = {'course_key': self.FAKE_COURSE, 'enabled': True}
        form = VerifiedTrackCourseForm(data=form_data)
        self.assertFalse(form.is_valid())
        self.assertEqual(
            form.errors['course_key'],
            ['COURSE NOT FOUND.  Please check that the course ID is valid.']
        )

        form_data = {'course_key': self.BAD_COURSE_KEY, 'enabled': True}
        form = VerifiedTrackCourseForm(data=form_data)
        self.assertFalse(form.is_valid())
        self.assertEqual(
            form.errors['course_key'],
            ['COURSE NOT FOUND.  Please check that the course ID is valid.']
        )
Esempio n. 3
0
    def test_form_validation_failure(self):
        form_data = {'course_key': self.FAKE_COURSE, 'enabled': True}
        form = VerifiedTrackCourseForm(data=form_data)
        self.assertFalse(form.is_valid())
        self.assertEqual(
            form.errors['course_key'],
            ['COURSE NOT FOUND.  Please check that the course ID is valid.'])

        form_data = {'course_key': self.BAD_COURSE_KEY, 'enabled': True}
        form = VerifiedTrackCourseForm(data=form_data)
        self.assertFalse(form.is_valid())
        self.assertEqual(
            form.errors['course_key'],
            ['COURSE NOT FOUND.  Please check that the course ID is valid.'])
Esempio n. 4
0
 def test_form_validation_success(self):
     form_data = {'course_key': unicode(self.course.id), 'enabled': True}
     form = VerifiedTrackCourseForm(data=form_data)
     self.assertTrue(form.is_valid())