@pytest.mark.django_db
def test_errors_when_sending_a_mutation_via_get(client):
    response = client.get(url_string(query='\n        mutation TestMutation { writeTest { test } }\n        '))
    assert (response.status_code == 405)
    assert (response['Content-Type'].split(';')[0] == 'application/json')
    expected_dict = {'errors': [{'message': 'Can only perform a mutation operation from a POST request.'}]}
    assert (response.json() == expected_dict)
@pytest.mark.django_db
def test_errors_when_sending_a_mutation_via_get(client):
    response = client.get(url_string(query='\n        mutation TestMutation { writeTest { test } }\n        '))
    assert (response.status_code == 405)
    assert (response['Content-Type'].split(';')[0] == 'application/json')
    expected_dict = {'errors': [{'message': 'Can only perform a mutation operation from a POST request.'}]}
    assert (response.json() == expected_dict)