Ejemplo n.º 1
0
 def test_date_inclusive_boundaries(self):
     test_model = Date.customize(ge=datetime.date(2016, 1, 1),
         le=datetime.date(2016, 2, 1))
     self.assertTrue(
           test_model.validate_native(test_model, datetime.date(2016, 1, 1)))
     self.assertTrue(
           test_model.validate_native(test_model, datetime.date(2016, 2, 1)))
Ejemplo n.º 2
0
 def test_date_exclusive_boundaries(self):
     test_model = Date.customize(gt=datetime.date(2016, 1, 1),
         lt=datetime.date(2016, 2, 1))
     self.assertFalse(
           test_model.validate_native(test_model, datetime.date(2016, 1, 1)))
     self.assertFalse(
           test_model.validate_native(test_model, datetime.date(2016, 2, 1)))