@@ -106,7 +106,7 @@ def setUpTestData(cls):
106
106
),
107
107
],
108
108
)
109
- cls .new_descoveries = Exhibit .objects .create (
109
+ cls .new_discoveries = Exhibit .objects .create (
110
110
name = "New Discoveries" ,
111
111
sections = [
112
112
Section (
@@ -175,7 +175,7 @@ def test_nested_array_index(self):
175
175
176
176
def test_array_slice (self ):
177
177
self .assertSequenceEqual (
178
- Exhibit .objects .filter (sections__0_1__number = 2 ), [self .new_descoveries ]
178
+ Exhibit .objects .filter (sections__0_1__number = 2 ), [self .new_discoveries ]
179
179
)
180
180
181
181
def test_filter_unsupported_lookups_in_json (self ):
@@ -190,7 +190,7 @@ def test_len(self):
190
190
self .assertCountEqual (Exhibit .objects .filter (sections__len = 10 ), [])
191
191
self .assertCountEqual (
192
192
Exhibit .objects .filter (sections__len = 1 ),
193
- [self .egypt , self .new_descoveries ],
193
+ [self .egypt , self .new_discoveries ],
194
194
)
195
195
# Nested EMF
196
196
self .assertCountEqual (
@@ -210,26 +210,26 @@ def test_in(self):
210
210
)
211
211
self .assertCountEqual (
212
212
Exhibit .objects .filter (sections__number__in = [2 ]),
213
- [self .new_descoveries , self .wonders ],
213
+ [self .new_discoveries , self .wonders ],
214
214
)
215
215
self .assertCountEqual (Exhibit .objects .filter (sections__number__in = [3 ]), [])
216
216
217
217
def test_iexact (self ):
218
218
self .assertCountEqual (
219
219
Exhibit .objects .filter (sections__artifacts__0__name__iexact = "lightHOuse of aLexandriA" ),
220
- [self .new_descoveries , self .wonders ],
220
+ [self .new_discoveries , self .wonders ],
221
221
)
222
222
223
223
def test_gt (self ):
224
224
self .assertCountEqual (
225
225
Exhibit .objects .filter (sections__number__gt = 1 ),
226
- [self .new_descoveries , self .wonders ],
226
+ [self .new_discoveries , self .wonders ],
227
227
)
228
228
229
229
def test_gte (self ):
230
230
self .assertCountEqual (
231
231
Exhibit .objects .filter (sections__number__gte = 1 ),
232
- [self .egypt , self .new_descoveries , self .wonders ],
232
+ [self .egypt , self .new_discoveries , self .wonders ],
233
233
)
234
234
235
235
def test_lt (self ):
@@ -240,7 +240,7 @@ def test_lt(self):
240
240
def test_lte (self ):
241
241
self .assertCountEqual (
242
242
Exhibit .objects .filter (sections__number__lte = 2 ),
243
- [self .egypt , self .wonders , self .new_descoveries ],
243
+ [self .egypt , self .wonders , self .new_discoveries ],
244
244
)
245
245
246
246
def test_querying_array_not_allowed (self ):
@@ -296,11 +296,11 @@ def test_subquery_numeric_lookups(self):
296
296
section_number__in = models .OuterRef ("sections__number" )
297
297
).values ("section_number" )[:1 ]
298
298
tests = [
299
- ("exact" , [self .egypt , self .new_descoveries , self .wonders ]),
299
+ ("exact" , [self .egypt , self .new_discoveries , self .wonders ]),
300
300
("lt" , []),
301
- ("lte" , [self .egypt , self .new_descoveries , self .wonders ]),
301
+ ("lte" , [self .egypt , self .new_discoveries , self .wonders ]),
302
302
("gt" , [self .wonders ]),
303
- ("gte" , [self .egypt , self .new_descoveries , self .wonders ]),
303
+ ("gte" , [self .egypt , self .new_discoveries , self .wonders ]),
304
304
]
305
305
for lookup , expected in tests :
306
306
with self .subTest (lookup = lookup ):
@@ -310,28 +310,28 @@ def test_subquery_numeric_lookups(self):
310
310
def test_subquery_in_lookup (self ):
311
311
subquery = Audit .objects .filter (reviewed = True ).values_list ("section_number" , flat = True )
312
312
result = Exhibit .objects .filter (sections__number__in = subquery )
313
- self .assertCountEqual (result , [self .wonders , self .new_descoveries , self .egypt ])
313
+ self .assertCountEqual (result , [self .wonders , self .new_discoveries , self .egypt ])
314
314
315
315
def test_array_as_rhs (self ):
316
316
result = Exhibit .objects .filter (main_section__number__in = models .F ("sections__number" ))
317
- self .assertCountEqual (result , [self .new_descoveries ])
317
+ self .assertCountEqual (result , [self .new_discoveries ])
318
318
319
319
def test_array_annotation_lookup (self ):
320
320
result = Exhibit .objects .annotate (section_numbers = models .F ("main_section__number" )).filter (
321
321
section_numbers__in = models .F ("sections__number" )
322
322
)
323
- self .assertCountEqual (result , [self .new_descoveries ])
323
+ self .assertCountEqual (result , [self .new_discoveries ])
324
324
325
325
def test_array_as_rhs_for_arrayfield_lookups (self ):
326
326
tests = [
327
327
("exact" , [self .wonders ]),
328
- ("lt" , [self .new_descoveries ]),
329
- ("lte" , [self .wonders , self .new_descoveries ]),
328
+ ("lt" , [self .new_discoveries ]),
329
+ ("lte" , [self .wonders , self .new_discoveries ]),
330
330
("gt" , [self .egypt , self .lost_empires ]),
331
331
("gte" , [self .egypt , self .wonders , self .lost_empires ]),
332
- ("overlap" , [self .egypt , self .wonders , self .new_descoveries ]),
332
+ ("overlap" , [self .egypt , self .wonders , self .new_discoveries ]),
333
333
("contained_by" , [self .wonders ]),
334
- ("contains" , [self .egypt , self .wonders , self .new_descoveries , self .lost_empires ]),
334
+ ("contains" , [self .egypt , self .wonders , self .new_discoveries , self .lost_empires ]),
335
335
]
336
336
for lookup , expected in tests :
337
337
with self .subTest (lookup = lookup ):
@@ -350,7 +350,7 @@ def test_array_annotation_index(self):
350
350
result = Exhibit .objects .annotate (section_numbers = models .F ("sections__number" )).filter (
351
351
section_numbers__0 = 1
352
352
)
353
- self .assertCountEqual (result , [self .new_descoveries , self .egypt ])
353
+ self .assertCountEqual (result , [self .new_discoveries , self .egypt ])
354
354
355
355
def test_array_annotation (self ):
356
356
qs = Exhibit .objects .annotate (section_numbers = models .F ("sections__number" )).order_by ("name" )
0 commit comments