Ejemplo n.º 1
0
 def test_invalid(self):
     form_data = self.form_data.copy()
     form_data['name'] = ''
     region_form = RegionForm(form_data)
     self.assertFalse(region_form.is_valid())
     message = 'This field is required.'
     self.assertEqual([message], region_form.errors['name'])
Ejemplo n.º 2
0
 def test_valid(self):
     region_form = RegionForm(self.form_data)
     self.assertTrue(region_form.is_valid())