diff options
author | 2019-04-07 18:35:37 +0100 | |
---|---|---|
committer | 2019-04-07 18:35:37 +0100 | |
commit | d06fd493b865ae2936709cc0875bbb9d56e58c62 (patch) | |
tree | 787f45a1ba5e1f16b9cd7d9e8cdf660573914151 /pydis_site/apps/api/tests/base.py | |
parent | Use volume for staticfiles. (diff) |
Address review by @jchristgit
Diffstat (limited to 'pydis_site/apps/api/tests/base.py')
-rw-r--r-- | pydis_site/apps/api/tests/base.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/api/tests/base.py b/pydis_site/apps/api/tests/base.py index 0290fa69..8f8ace56 100644 --- a/pydis_site/apps/api/tests/base.py +++ b/pydis_site/apps/api/tests/base.py @@ -28,7 +28,7 @@ class APISubdomainTestCase(APITestCase): If you don't want to force authentication (for example, to test a route's response for an unauthenticated user), un-force authentication by using the following: - >>> from pydis_site.apps.api import APISubdomainTestCase + >>> from pydis_site.apps.api.tests.base import APISubdomainTestCase >>> class UnauthedUserTestCase(APISubdomainTestCase): ... def setUp(self): ... super().setUp() @@ -46,7 +46,7 @@ class APISubdomainTestCase(APITestCase): ## Example Using this in a test case is rather straightforward: - >>> from pydis_site.apps.api import APISubdomainTestCase + >>> from pydis_site.apps.api.tests.base import APISubdomainTestCase >>> class MyAPITestCase(APISubdomainTestCase): ... def test_that_it_works(self): ... response = self.client.get('/my-endpoint') @@ -55,7 +55,7 @@ class APISubdomainTestCase(APITestCase): To reverse URLs of the API host, you need to use `django_hosts`: >>> from django_hosts.resolvers import reverse - >>> from pydis_site.apps.api import APISubdomainTestCase + >>> from pydis_site.apps.api.tests.base import APISubdomainTestCase >>> class MyReversedTestCase(APISubdomainTestCase): ... def test_my_endpoint(self): ... url = reverse('user-detail', host='api') |