Exemple #1
0
 def test_range_compare_min_pass(self):
     r = DateRange()
     self.assertTrue(
         r.timeCompare('2017-11-24', {
             'min': '2017-11-24',
             'format': '%Y-%m-%d'
         }))
Exemple #2
0
 def test_range_compare_max_fail(self):
     r = DateRange()
     self.assertFalse(
         r.timeCompare('2017-11-24', {
             'max': '2017-11-23',
             'format': '%Y-%m-%d'
         }))
Exemple #3
0
 def test_range_compare_bad_field_type(self):
     r = DateRange()
     self.assertFalse(
         r.timeCompare('cats', {
             'min': '2017-11-24',
             'max': '2017-11-26',
             'format': '%Y-%m-%d'
         }))
Exemple #4
0
 def test_range_compare_bad_min_or_max(self):
     r = DateRange()
     self.assertFalse(
         r.timeCompare('2017-11-23', {
             'min': '2017-11-24',
             'format': '%Y-%m-%d'
         }))
     self.assertFalse(
         r.timeCompare('2017-11-25', {
             'max': '2017-11-24',
             'format': '%Y-%m-%d'
         }))
     self.assertFalse(
         r.timeCompare('2017-11-27', {
             'min': '2017-11-24',
             'max': '2017-11-26',
             'format': '%Y-%m-%d'
         }))
Exemple #5
0
 def test_range_compare_no_min_or_max(self):
     r = DateRange()
     self.assertFalse(r.timeCompare('2017-11-24', {}))