summaryrefslogtreecommitdiff
path: root/tests/schema/fields.py
diff options
context:
space:
mode:
authorVytis Banaitis <vytis.banaitis@gmail.com>2017-02-01 18:41:56 +0200
committerTim Graham <timograham@gmail.com>2017-02-01 11:41:56 -0500
commit8838d4dd498c8f66ea4237fe8a79a5f77d6f95c9 (patch)
treeb75fa27930b8758ad36669b523b084ac09ce290b /tests/schema/fields.py
parent0ec4dc91e0e7befdd06aa0613b5d0fbe3c785ee7 (diff)
Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.
Diffstat (limited to 'tests/schema/fields.py')
-rw-r--r--tests/schema/fields.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/schema/fields.py b/tests/schema/fields.py
index 16a61ee5f6..f03b9813b6 100644
--- a/tests/schema/fields.py
+++ b/tests/schema/fields.py
@@ -13,23 +13,24 @@ class CustomManyToManyField(RelatedField):
"""
many_to_many = True
- def __init__(self, to, db_constraint=True, swappable=True, **kwargs):
+ def __init__(self, to, db_constraint=True, swappable=True, related_name=None, related_query_name=None,
+ limit_choices_to=None, symmetrical=None, through=None, through_fields=None, db_table=None, **kwargs):
try:
to._meta
except AttributeError:
to = str(to)
kwargs['rel'] = ManyToManyRel(
self, to,
- related_name=kwargs.pop('related_name', None),
- related_query_name=kwargs.pop('related_query_name', None),
- limit_choices_to=kwargs.pop('limit_choices_to', None),
- symmetrical=kwargs.pop('symmetrical', to == RECURSIVE_RELATIONSHIP_CONSTANT),
- through=kwargs.pop('through', None),
- through_fields=kwargs.pop('through_fields', None),
+ related_name=related_name,
+ related_query_name=related_query_name,
+ limit_choices_to=limit_choices_to,
+ symmetrical=symmetrical if symmetrical is not None else (to == RECURSIVE_RELATIONSHIP_CONSTANT),
+ through=through,
+ through_fields=through_fields,
db_constraint=db_constraint,
)
self.swappable = swappable
- self.db_table = kwargs.pop('db_table', None)
+ self.db_table = db_table
if kwargs['rel'].through is not None:
assert self.db_table is None, "Cannot specify a db_table if an intermediary model is used."
super().__init__(**kwargs)