@@ -175,20 +175,22 @@ def test_multiple_match_any_name(self):
175
175
self .assert_first_names (doc , ['Jamie' , 'Jimbo' ])
176
176
177
177
def test_no_match_started_after (self ):
178
+ now = datetime .now ()
178
179
doc = self .assert_get_in (
179
180
[200 ], 'With no match checking started_after' ,
180
- query_args = {'started_after' : '2019 -10-31' }
181
+ query_args = {'started_after' : str ( now . year + 10 ) + ' -10-31' }
181
182
).json ()
182
183
self .assertEqual (doc ['students' ], [])
183
184
184
185
def test_multiple_matches_started_after (self ):
185
- self .create (first_name = "Chuck" , started_at = "2016-11-09" )
186
- self .create (first_name = "Carol" , started_at = "2019-01-13" )
187
- self .create (first_name = "Cindy" , started_at = "2018-04-08" )
188
- self .create (first_name = "Carl" , started_at = "2017-09-12" )
186
+ now = datetime .now ()
187
+ self .create (first_name = "Chuck" , started_at = str (now .year - 2 )+ "-11-09" )
188
+ self .create (first_name = "Carol" , started_at = str (now .year + 3 )+ "-01-13" )
189
+ self .create (first_name = "Cindy" , started_at = str (now .year + 2 )+ "-04-08" )
190
+ self .create (first_name = "Carl" , started_at = str (now .year - 1 )+ "-09-12" )
189
191
doc = self .assert_get_in (
190
192
[200 ], 'With multiple matches checking started_after' ,
191
- query_args = {'started_after' : '2018 -03-31' }
193
+ query_args = {'started_after' : str ( now . year + 1 ) + ' -03-31' }
192
194
).json ()
193
195
self .assert_first_names (doc , ['Carol' , 'Cindy' ])
194
196
0 commit comments