Skip to content

Commit

Permalink
Reuse test logic
Browse files Browse the repository at this point in the history
Test is identical, but we need the decorator on one of them.
  • Loading branch information
msopacua committed Dec 7, 2023
1 parent e3ba815 commit 54bf902
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/django/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
]


def test_render_graphiql_template():
def run_sync_view():
headers = {
"Accept": "text/html",
}
Expand All @@ -22,11 +22,10 @@ def test_render_graphiql_template():
assert 'JSON.parse("false")' in response.content.decode()


def test_render_graphiql_template():
run_sync_view()


@override_settings(TEMPLATES=TEMPLATES)
def test_subscription_enabled_not_empty():
headers = {
"Accept": "text/html",
}
client = Client(headers=headers)
response: HttpResponse = client.get("/graphql/")
assert 'JSON.parse("false")' in response.content.decode()
run_sync_view()

0 comments on commit 54bf902

Please sign in to comment.