@pytest.mark.django_db
def test_batch_fails_if_is_empty(client):
    response = client.post(batch_url_string(), '[]', 'application/json')
    assert (response.status_code == 400)
    assert (response['Content-Type'].split(';')[0] == 'application/json')
    expected_dict = {'errors': [{'message': 'Received an empty list in the batch request.'}]}
    assert (response.json() == expected_dict)
@pytest.mark.django_db
def test_batch_fails_if_is_empty(client):
    response = client.post(batch_url_string(), '[]', 'application/json')
    assert (response.status_code == 400)
    assert (response['Content-Type'].split(';')[0] == 'application/json')
    expected_dict = {'errors': [{'message': 'Received an empty list in the batch request.'}]}
    assert (response.json() == expected_dict)