示例#1
0
 def test_not_between(self):
     filter = TimeFilter(Person.start_time)
     filter.set('!between', '9:00 am', '5:00 pm')
     self.assert_filter_query(
         filter,
         "WHERE persons.start_time NOT BETWEEN CAST('09:00:00.000000' AS TIME) AND "
         "CAST('17:00:00.000000' AS TIME)")
示例#2
0
 def test_not_between(self):
     filter = TimeFilter(Person.start_time)
     filter.set('!between', '9:00 am', '5:00 pm')
     self.assert_filter_query(
         filter,
         "WHERE persons.start_time NOT BETWEEN CAST('09:00:00.000000' AS TIME) AND "
         "CAST('17:00:00.000000' AS TIME)")
示例#3
0
 def test_not_empty(self):
     filter = TimeFilter(Person.start_time)
     filter.set('!empty', None)
     self.assert_filter_query(filter, "WHERE persons.start_time IS NOT NULL")
示例#4
0
 def test_gte(self):
     filter = TimeFilter(Person.start_time)
     filter.set('gte', '10:15 am')
     self.assert_filter_query(filter,
                              "WHERE persons.start_time >= CAST('10:15:00.000000' AS TIME)")
示例#5
0
 def test_lte(self):
     filter = TimeFilter(Person.start_time)
     filter.set('lte', '9:00 am')
     self.assert_filter_query(filter,
                              "WHERE persons.start_time <= CAST('09:00:00.000000' AS TIME)")
示例#6
0
 def test_not_eq(self):
     filter = TimeFilter(Person.start_time)
     filter.set('!eq', '11:30 pm')
     self.assert_filter_query(filter,
                              "WHERE persons.start_time != CAST('23:30:00.000000' AS TIME)")
示例#7
0
 def test_not_empty(self):
     filter = TimeFilter(Person.start_time)
     filter.set('!empty', None)
     self.assert_filter_query(filter, "WHERE persons.start_time IS NOT NULL")
示例#8
0
 def test_gte(self):
     filter = TimeFilter(Person.start_time)
     filter.set('gte', '10:15 am')
     self.assert_filter_query(filter,
                              "WHERE persons.start_time >= CAST('10:15:00.000000' AS TIME)")
示例#9
0
 def test_lte(self):
     filter = TimeFilter(Person.start_time)
     filter.set('lte', '9:00 am')
     self.assert_filter_query(filter,
                              "WHERE persons.start_time <= CAST('09:00:00.000000' AS TIME)")
示例#10
0
 def test_not_eq(self):
     filter = TimeFilter(Person.start_time)
     filter.set('!eq', '11:30 pm')
     self.assert_filter_query(filter,
                              "WHERE persons.start_time != CAST('23:30:00.000000' AS TIME)")