示例#1
0
 def test_before_raise_if_date_value_and_datetime_point_are_the_same(self):
     dbdt = SuperDate(dbdt=date(2020, 4, 3))
     with self.assertRaises(ValidationException) as context:
         dbdt.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['dbdt'],
                      "value is too late")
示例#2
0
 def test_before_raise_if_datetime_value_later_than_date_point(self):
     dtbd = SuperDate(dtbd=datetime(2020, 4, 4, 0, 0))
     with self.assertRaises(ValidationException) as context:
         dtbd.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['dtbd'],
                      "value is too late")
示例#3
0
 def test_after_raise_if_datetime_value_earlier_than_date_point(self):
     dtad = SuperDate(dtad=datetime(2020, 4, 2, 0, 0))
     with self.assertRaises(ValidationException) as context:
         dtad.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['dtad'],
                      "value is too early")
示例#4
0
 def test_after_raise_if_date_value_and_date_point_are_the_same(self):
     dad = SuperDate(dad=date(2020, 4, 3))
     with self.assertRaises(ValidationException) as context:
         dad.validate()
     self.assertEqual(len(context.exception.keypath_messages), 1)
     self.assertEqual(context.exception.keypath_messages['dad'],
                      "value is too early")
示例#5
0
 def test_before_does_not_raise_if_date_value_is_before_date_point(self):
     dbd = SuperDate(dbd=date(2020, 4, 2))
     dbd.validate()
示例#6
0
 def test_before_does_not_raise_if_datetime_value_is_before_date_piont(
         self):
     dtbd = SuperDate(dtbd=datetime(2020, 4, 2, 12, 30))
     dtbd.validate()
示例#7
0
 def test_before_does_not_raise_if_date_value_is_before_datetime_piont(
         self):
     dbdt = SuperDate(dbdt=date(2020, 4, 2))
     dbdt.validate()
示例#8
0
 def test_after_dosent_raise_if_date_value_is_after_date_point(self):
     dad = SuperDate(dad=date(2020, 4, 4))
     dad.validate()
示例#9
0
 def test_after_does_not_raise_if_date_value_is_after_types_date_piont(self):
     datd = SuperDate(datd=date(2020, 4, 4))
     datd.validate()
示例#10
0
 def test_after_does_not_raise_if_date_value_is_after_callable_date_point(self):
     dacd = SuperDate(dacd=date(2020, 4, 4))
     dacd.validate()
示例#11
0
 def test_after_dosent_raise_if_datetime_value_is_after_date_piont(self):
     dtad = SuperDate(dtad=datetime(2020, 4, 4, 12, 30))
     dtad.validate()
示例#12
0
 def test_after_dosent_raise_if_date_value_is_after_datetime_piont(self):
     dadt = SuperDate(dadt=date(2020, 4, 4))
     dadt.validate()