Skip to content

Commit ecbf307

Browse files
committed
update test readability for #1385
1 parent 8742ca3 commit ecbf307

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

graphene_django/rest_framework/tests/test_mutation.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,25 +288,16 @@ class SomeCreateSerializerMutation(SerializerMutation):
288288
class Meta:
289289
serializer_class = ListViewChoiceFieldSerializer
290290

291+
choice_type = {
292+
"choice_type": SomeCreateSerializerMutation.Input.choice_type.type.get("ASDF")
293+
}
291294
result = SomeCreateSerializerMutation.mutate_and_get_payload(
292-
None,
293-
mock_info(),
294-
**{
295-
"choice_type": SomeCreateSerializerMutation.Input.choice_type.type.get(
296-
"ASDF"
297-
)
298-
}
295+
None, mock_info(), **choice_type
299296
)
300297
assert result.errors is None
301298
assert result.choice_type == MyFakeModelWithChoiceField.ChoiceType.ASDF.name
302299
kwargs = SomeCreateSerializerMutation.get_serializer_kwargs(
303-
None,
304-
mock_info(),
305-
**{
306-
"choice_type": SomeCreateSerializerMutation.Input.choice_type.type.get(
307-
"ASDF"
308-
)
309-
}
300+
None, mock_info(), **choice_type
310301
)
311302
assert (
312303
kwargs["data"]["choice_type"] == MyFakeModelWithChoiceField.ChoiceType.ASDF.name

0 commit comments

Comments
 (0)