Ejemplo n.º 1
0
 def test_date_diff_form_no_date(self):
     form_data = {}
     form = dates.DateDiffForm(data=form_data)
     self.assertRaises(forms.ValidationError)
     self.assertFalse(form.is_valid())
Ejemplo n.º 2
0
 def test_date_diff_form_wrong_param_name(self):
     form_data = {'start': '2019-12-18'}
     form = dates.DateDiffForm(data=form_data)
     self.assertRaises(forms.ValidationError)
     self.assertFalse(form.is_valid())
Ejemplo n.º 3
0
 def test_date_diff_form_invalid_date(self):
     form_data = {'start_date': '2019-22-22'}
     form = dates.DateDiffForm(data=form_data)
     self.assertRaises(forms.ValidationError)
     self.assertFalse(form.is_valid())
Ejemplo n.º 4
0
 def test_date_diff_form_valid(self):
     form_data = {'start_date': '2019-12-18'}
     form = dates.DateDiffForm(data=form_data)
     self.assertTrue(form.is_valid())