Skip to content

Commit be765e0

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

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

graphene_django/rest_framework/tests/test_mutation.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,20 +291,19 @@ class Meta:
291291
choice_type = {
292292
"choice_type": SomeCreateSerializerMutation.Input.choice_type.type.get("ASDF")
293293
}
294+
name = MyFakeModelWithChoiceField.ChoiceType.ASDF.name
294295
result = SomeCreateSerializerMutation.mutate_and_get_payload(
295296
None, mock_info(), **choice_type
296297
)
297298
assert result.errors is None
298-
assert result.choice_type == MyFakeModelWithChoiceField.ChoiceType.ASDF.name
299+
assert result.choice_type == name
299300
kwargs = SomeCreateSerializerMutation.get_serializer_kwargs(
300301
None, mock_info(), **choice_type
301302
)
302-
assert (
303-
kwargs["data"]["choice_type"] == MyFakeModelWithChoiceField.ChoiceType.ASDF.name
304-
)
303+
assert kwargs["data"]["choice_type"] == name
305304
assert 1 == MyFakeModelWithChoiceField.objects.count()
306305
item = MyFakeModelWithChoiceField.objects.first()
307-
assert item.choice_type == MyFakeModelWithChoiceField.ChoiceType.ASDF.name
306+
assert item.choice_type == name
308307

309308

310309
def test_mutate_and_get_payload_error():

0 commit comments

Comments
 (0)