Add test for appending slashes to URLs in the right situations

This commit is contained in:
Raphael Michel
2020-11-06 10:49:24 +01:00
parent d03c5ce30c
commit a7565342c0

View File

@@ -0,0 +1,14 @@
import pytest
@pytest.mark.django_db
def test_get(token_client, organizer, event, team):
resp = token_client.get('/api/v1/organizers/{}/teams'.format(organizer.slug), follow=False)
assert resp.status_code == 301
assert resp['Location'].endswith('/')
@pytest.mark.django_db
def test_post(token_client, organizer, event, team):
resp = token_client.post('/api/v1/organizers/{}/teams'.format(organizer.slug), follow=False)
assert resp.status_code == 404