diff options
author | 2018-08-15 21:46:56 +0200 | |
---|---|---|
committer | 2018-08-15 21:46:56 +0200 | |
commit | fc38b383ea99df7f0c26bd94d04445c88527d566 (patch) | |
tree | 6c2111a4766067437aeab3e2c1eaf0d4e1efaa3f /api/tests | |
parent | Use `reverse` from `django-hosts`. (diff) |
Use viewsets and the `rest_framework` router.
Diffstat (limited to 'api/tests')
-rw-r--r-- | api/tests/__init__.py | 0 | ||||
-rw-r--r-- | api/tests/test_snake_names.py | 10 |
2 files changed, 10 insertions, 0 deletions
diff --git a/api/tests/__init__.py b/api/tests/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/api/tests/__init__.py diff --git a/api/tests/test_snake_names.py b/api/tests/test_snake_names.py new file mode 100644 index 00000000..14574311 --- /dev/null +++ b/api/tests/test_snake_names.py @@ -0,0 +1,10 @@ +from django_hosts.resolvers import reverse +from rest_framework.test import APITestCase, force_authenticate + + +class EmptyDatabaseSnakeNameTests(APITestCase): + def test_endpoint_returns_empty_list(self): + import pdb; pdb.set_trace() + url = reverse('snake-names-list', host='api') + response = self.client.get(url) + self.assertEqual(response.status_code, 200) |