From d06fd493b865ae2936709cc0875bbb9d56e58c62 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Sun, 7 Apr 2019 18:35:37 +0100 Subject: Address review by @jchristgit --- pydis_site/apps/api/tests/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pydis_site/apps/api/tests/base.py') 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') -- cgit v1.2.3