aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2019-04-07 18:35:37 +0100
committerGravatar Gareth Coles <[email protected]>2019-04-07 18:35:37 +0100
commitd06fd493b865ae2936709cc0875bbb9d56e58c62 (patch)
tree787f45a1ba5e1f16b9cd7d9e8cdf660573914151 /pydis_site
parentUse volume for staticfiles. (diff)
Address review by @jchristgit
Diffstat (limited to 'pydis_site')
-rw-r--r--pydis_site/apps/api/tests/base.py6
-rw-r--r--pydis_site/apps/api/validators.py2
-rw-r--r--pydis_site/apps/api/viewsets.py2
3 files changed, 5 insertions, 5 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')
diff --git a/pydis_site/apps/api/validators.py b/pydis_site/apps/api/validators.py
index ac2fb739..69a8d1ef 100644
--- a/pydis_site/apps/api/validators.py
+++ b/pydis_site/apps/api/validators.py
@@ -86,7 +86,7 @@ def validate_tag_embed(embed):
>>> from django.contrib.postgres import fields as pgfields
>>> from django.db import models
- >>> from pydis_site.apps.api import validate_tag_embed
+ >>> from pydis_site.apps.api.validators import validate_tag_embed
>>> class MyMessage(models.Model):
... embed = pgfields.JSONField(
... validators=(
diff --git a/pydis_site/apps/api/viewsets.py b/pydis_site/apps/api/viewsets.py
index 17024fe8..949ffaaa 100644
--- a/pydis_site/apps/api/viewsets.py
+++ b/pydis_site/apps/api/viewsets.py
@@ -383,7 +383,7 @@ class ReminderViewSet(CreateModelMixin, ListModelMixin, DestroyModelMixin, Gener
... 'active': True,
... 'author': 1020103901030,
... 'content': "Make dinner",
- ... 'expiration': '5018-11-20T15:52:00Z'
+ ... 'expiration': '5018-11-20T15:52:00Z',
... 'id': 11
... },
... ...