mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #26125 -- Fixed E731 flake warnings.
This commit is contained in:
parent
abc0777b63
commit
60586dd737
36 changed files with 176 additions and 75 deletions
|
@ -68,7 +68,8 @@ class DataTests(OptionsBaseTests):
|
|||
self.assertEqual([f.attname for f in fields], expected_result)
|
||||
|
||||
def test_local_fields(self):
|
||||
is_data_field = lambda f: isinstance(f, Field) and not isinstance(f, related.ManyToManyField)
|
||||
def is_data_field(f):
|
||||
return isinstance(f, Field) and not isinstance(f, related.ManyToManyField)
|
||||
|
||||
for model, expected_result in TEST_RESULTS['local_fields'].items():
|
||||
fields = model._meta.local_fields
|
||||
|
@ -101,7 +102,8 @@ class M2MTests(OptionsBaseTests):
|
|||
|
||||
|
||||
class RelatedObjectsTests(OptionsBaseTests):
|
||||
key_name = lambda self, r: r[0]
|
||||
def key_name(self, r):
|
||||
return r[0]
|
||||
|
||||
def test_related_objects(self):
|
||||
result_key = 'get_all_related_objects_with_model'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue