From 38709d83967bba6f19d6f0d6888b8b4f1cf2f720 Mon Sep 17 00:00:00 2001 From: Kien Dang Date: Sat, 27 May 2023 21:53:22 +0800 Subject: [PATCH] Correct schema write test (#1416) .called_once() just returns a Mock, so assert .called_once() always passes. We want .assert_called_once(). --- graphene_django/tests/test_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene_django/tests/test_command.py b/graphene_django/tests/test_command.py index a281abbd2..f7325d569 100644 --- a/graphene_django/tests/test_command.py +++ b/graphene_django/tests/test_command.py @@ -46,7 +46,7 @@ class Query(ObjectType): open_mock.assert_called_once() handle = open_mock() - assert handle.write.called_once() + handle.write.assert_called_once() schema_output = handle.write.call_args[0][0] assert schema_output == dedent(