@@ -122,7 +122,7 @@ def setUpTestData(cls):
122
122
exhibit_name = "New Discoveries" ,
123
123
sections = [
124
124
ExhibitSection (
125
- section_number = 1 ,
125
+ section_number = 2 ,
126
126
artifacts = [
127
127
ArtifactDetail (
128
128
name = "Lighthouse of Alexandria" ,
@@ -167,13 +167,13 @@ def test_filter_with_field(self):
167
167
def test_filter_with_embeddedfield_path (self ):
168
168
self .assertCountEqual (
169
169
MuseumExhibit .objects .filter (sections__0__section_number = 1 ),
170
- [self .egypt , self .wonders , self . new_descoveries ],
170
+ [self .egypt , self .wonders ],
171
171
)
172
172
173
173
def test_filter_with_embeddedfield_array_path (self ):
174
174
self .assertCountEqual (
175
175
MuseumExhibit .objects .filter (
176
- main_section__artifacts__restorations__0__restored_by = "Restoration Lab A "
176
+ main_section__artifacts__restorations__0__restored_by = "Zacarias "
177
177
),
178
178
[self .lost_empires ],
179
179
)
@@ -190,7 +190,8 @@ def test_filter_unsupported_lookups(self):
190
190
def test_len (self ):
191
191
self .assertCountEqual (MuseumExhibit .objects .filter (sections__len = 10 ), [])
192
192
self .assertCountEqual (
193
- MuseumExhibit .objects .filter (sections__len = 1 ), [self .egypt , self .new_descoveries ]
193
+ MuseumExhibit .objects .filter (sections__len = 1 ),
194
+ [self .egypt , self .wonders , self .new_descoveries ],
194
195
)
195
196
# Nested EMF
196
197
self .assertCountEqual (
@@ -202,23 +203,23 @@ def test_len(self):
202
203
self .assertCountEqual (
203
204
MuseumExhibit .objects .filter (sections__0__artifacts__len = 2 ), [self .wonders ]
204
205
)
205
- self .assertCountEqual (
206
- MuseumExhibit .objects .filter (sections__0__artifacts__len = 0 ), [self .new_descoveries ]
207
- )
208
- self .assertCountEqual (
209
- MuseumExhibit .objects .filter (sections__1__artifacts__len = 1 ), [self .wonders ]
210
- )
206
+ self .assertCountEqual (MuseumExhibit .objects .filter (sections__0__artifacts__len = 0 ), [])
207
+ self .assertCountEqual (MuseumExhibit .objects .filter (sections__1__artifacts__len = 1 ), [])
211
208
212
209
def test_overlap_simplefield (self ):
213
210
self .assertSequenceEqual (
214
211
MuseumExhibit .objects .filter (sections__section_number__overlap = [10 ]), []
215
212
)
216
213
self .assertSequenceEqual (
217
214
MuseumExhibit .objects .filter (sections__section_number__overlap = [1 ]),
218
- [self .egypt , self .wonders , self .new_descoveries ],
215
+ [self .egypt , self .wonders ],
216
+ )
217
+ self .assertSequenceEqual (
218
+ MuseumExhibit .objects .filter (sections__section_number__overlap = [2 ]),
219
+ [self .new_descoveries ],
219
220
)
220
221
self .assertSequenceEqual (
221
- MuseumExhibit .objects .filter (sections__section_number__overlap = [2 ]), [self . wonders ]
222
+ MuseumExhibit .objects .filter (sections__section_number__overlap = [3 ]), []
222
223
)
223
224
224
225
0 commit comments