Skip to content

Commit

Permalink
[4.2.x] Fix graphql test
Browse files Browse the repository at this point in the history
(cherry picked from commit 1b87561)
  • Loading branch information
mxsasha committed Mar 29, 2022
1 parent cdf67e1 commit f535ce8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions irrd/server/graphql/tests/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def test_error_formatter():
# Regular GraphQL error should always be passed
error = GraphQLError(message='error')
result = error_formatter(error)
assert result == {'message': 'error', 'locations': None, 'path': None}
assert result['message'] == 'error'

# If original_error is something else, hide except when in debug mode
error = GraphQLError(message='error', original_error=ValueError())
result = error_formatter(error)
assert result == {'message': 'Internal server error', 'locations': None, 'path': None}
assert result['message'] == 'Internal server error'

result = error_formatter(error, debug=True)
assert result == {'message': 'error', 'locations': None, 'path': None,
'extensions': {'exception': None}}
assert result['message'] == 'error'
assert result['extensions'] == {'exception': None}

0 comments on commit f535ce8

Please sign in to comment.