forked from CGM_Public/pretix_original
Add test for appending slashes to URLs in the right situations
This commit is contained in:
14
src/tests/api/test_append_slash.py
Normal file
14
src/tests/api/test_append_slash.py
Normal 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
|
||||
Reference in New Issue
Block a user