@@ -235,9 +235,9 @@ def test_defer_fields(self):
235
235
236
236
objects_deferred = Model2A .objects .defer ("field1" ).order_by ("id" )
237
237
238
- assert (
239
- "field1" not in objects_deferred [ 0 ]. __dict__
240
- ), "field1 was not deferred (using defer())"
238
+ assert "field1" not in objects_deferred [ 0 ]. __dict__ , (
239
+ "field1 was not deferred (using defer())"
240
+ )
241
241
242
242
# Check that we have exactly one deferred field ('field1') per resulting object.
243
243
for obj in objects_deferred :
@@ -247,12 +247,12 @@ def test_defer_fields(self):
247
247
248
248
objects_only = Model2A .objects .only ("pk" , "polymorphic_ctype" , "field1" )
249
249
250
- assert (
251
- "field1" in objects_only [ 0 ]. __dict__
252
- ), 'qs.only("field1") was used, but field1 was incorrectly deferred'
253
- assert (
254
- "field1" in objects_only [ 3 ]. __dict__
255
- ), 'qs.only("field1") was used, but field1 was incorrectly deferred on a child model'
250
+ assert "field1" in objects_only [ 0 ]. __dict__ , (
251
+ 'qs.only( "field1") was used, but field1 was incorrectly deferred'
252
+ )
253
+ assert "field1" in objects_only [ 3 ]. __dict__ , (
254
+ 'qs.only( "field1") was used, but field1 was incorrectly deferred on a child model'
255
+ )
256
256
assert "field4" not in objects_only [3 ].__dict__ , "field4 was not deferred (using only())"
257
257
assert "field1" not in objects_only [0 ].get_deferred_fields ()
258
258
@@ -290,9 +290,9 @@ def test_defer_related_fields(self):
290
290
self .create_model2abcd ()
291
291
292
292
objects_deferred_field4 = Model2A .objects .defer ("Model2D___field4" )
293
- assert (
294
- "field4" not in objects_deferred_field4 [ 3 ]. __dict__
295
- ), "field4 was not deferred (using defer(), traversing inheritance)"
293
+ assert "field4" not in objects_deferred_field4 [ 3 ]. __dict__ , (
294
+ "field4 was not deferred (using defer(), traversing inheritance)"
295
+ )
296
296
assert objects_deferred_field4 [0 ].__class__ == Model2A
297
297
assert objects_deferred_field4 [1 ].__class__ == Model2B
298
298
assert objects_deferred_field4 [2 ].__class__ == Model2C
0 commit comments