Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maarcingebala committed Nov 20, 2019
1 parent 3fa0c8d commit 41ab821
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/api/test_graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def test_middleware_dont_generate_sql_requests(client, settings, assert_num_quer
# Enables the Graphql playground
settings.DEBUG = True

with assert_num_queries(0):
# DEMO: run 1 query to get product
with django_assert_num_queries(1):
response = client.get(reverse("api"))
assert response.status_code == 200

Expand Down
3 changes: 2 additions & 1 deletion tests/api/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def test_batch_queries(category, product, api_client):

def test_graphql_view_get_in_non_debug_mode(client):
response = client.get(API_PATH)
assert response.status_code == 405
# DEMO: On demo playground is rendered.
assert response.status_code == 200


@override_settings(DEBUG=True)
Expand Down

0 comments on commit 41ab821

Please sign in to comment.