Files
pretix_original/src/tests/api/test_organizers.py
Raphael Michel b2d4bea1d0 Refs #314 -- Read-only REST API (#513)
* initial commit

* API auth

* Hierarchical URLs

* Add session auth

* Strong hierarchy

* Add filters

* Add i18n fields, questions

* More viewsets and serializers

* Ticket download

* Add OrderPosition serializer

* View-level permissions

* More tests

* More tests

* Add basic API docs

* Add REST API to docs frontpage

* Tests for order endpoints

* Add invoice tests

* Voucher and waitinglist tests

* Doc draft

* order docs

* Docs on all viewsets

* Disable DRF docs, style sphinx, style browsable API

* Fix tests

* deprecated imports

* Test foo

* Attendee names

* Fix migration problems

* Remove browsable API, plugin integration

* Doc fixes
2017-06-19 11:16:04 +02:00

21 lines
528 B
Python

import pytest
TEST_ORGANIZER_RES = {
"name": "Dummy",
"slug": "dummy"
}
@pytest.mark.django_db
def test_organizer_list(token_client, organizer):
resp = token_client.get('/api/v1/organizers/')
assert resp.status_code == 200
assert TEST_ORGANIZER_RES in resp.data['results']
@pytest.mark.django_db
def test_organizer_detail(token_client, organizer):
resp = token_client.get('/api/v1/organizers/{}/'.format(organizer.slug))
assert resp.status_code == 200
assert TEST_ORGANIZER_RES == resp.data