@pytest.mark.django_db
def test_handles_poorly_formed_variables(client):
    response = client.get(url_string(query='query helloWho($who: String){ test(who: $who) }', variables='who:You'))
    assert (response.status_code == 400)
    assert (response['Content-Type'].split(';')[0] == 'application/json')
    expected_dict = {'errors': [{'message': 'Variables are invalid JSON.'}]}
    assert (response.json() == expected_dict)
@pytest.mark.django_db
def test_handles_poorly_formed_variables(client):
    response = client.get(url_string(query='query helloWho($who: String){ test(who: $who) }', variables='who:You'))
    assert (response.status_code == 400)
    assert (response['Content-Type'].split(';')[0] == 'application/json')
    expected_dict = {'errors': [{'message': 'Variables are invalid JSON.'}]}
    assert (response.json() == expected_dict)