mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-17 23:52:05 +03:00
Add a default msg to show the response content.
This seems like an issue with using assertResponseNoErrors and assertResponseHasErrors Which doesn't include any errors specific to the response and currently just shows. ```python self.assertNotIn("errors", list(content.keys())) AssertionError: 'errors' unexpectedly found in ['errors', 'data'] ```
This commit is contained in:
parent
eb7a0265d8
commit
030a8e7400
|
@ -111,7 +111,7 @@ class GraphQLTestCase(TestCase):
|
|||
"""
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
content = json.loads(resp.content)
|
||||
self.assertNotIn("errors", list(content.keys()), msg)
|
||||
self.assertNotIn("errors", list(content.keys()), msg or content)
|
||||
|
||||
def assertResponseHasErrors(self, resp, msg=None):
|
||||
"""
|
||||
|
@ -119,4 +119,4 @@ class GraphQLTestCase(TestCase):
|
|||
:resp HttpResponse: Response
|
||||
"""
|
||||
content = json.loads(resp.content)
|
||||
self.assertIn("errors", list(content.keys()), msg)
|
||||
self.assertIn("errors", list(content.keys()), msg or content)
|
||||
|
|
Loading…
Reference in New Issue
Block a user