Skip to content

Commit d915b3f

Browse files
committed
Fixed tests
1 parent 2408c16 commit d915b3f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/test_graphqlview.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
except ImportError:
1212
from urllib.parse import urlencode
1313

14-
from aiohttp.helpers import FormData
14+
try:
15+
from aiohttp.helpers import FormData
16+
except ImportError:
17+
from aiohttp.formdata import FormData
18+
1519
from graphql.execution.executors.asyncio import AsyncioExecutor
1620
from graphql.execution.executors.sync import SyncExecutor
1721

@@ -204,7 +208,7 @@ def test_allows_sending_a_mutation_via_post(app):
204208
def test_allows_post_with_url_encoding(app):
205209
data = FormData()
206210
data.add_field('query', '{test}')
207-
_, response = app.client.post(uri=url_string(), data=data('utf-8'), headers={'content-type': data.content_type})
211+
_, response = app.client.post(uri=url_string(), data=data(), headers={'content-type': 'application/x-www-form-urlencoded'})
208212

209213
assert response.status == 200
210214
assert response_json(response) == {

0 commit comments

Comments
 (0)