aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps
diff options
context:
space:
mode:
authorGravatar kosayoda <[email protected]>2020-07-19 12:49:04 +0800
committerGravatar kosayoda <[email protected]>2020-07-19 12:49:04 +0800
commitf6111a35e0b5385ccd02cea12d0afc4a86615ba0 (patch)
tree2951611413b4918c37425e1993c71cf2e055083a /pydis_site/apps
parentMerge migrations (diff)
Use literal integers for mentions ID in test
Since the mentions field stores static IDs and not foreign keys, there is no need to create the objects for the test.
Diffstat (limited to 'pydis_site/apps')
-rw-r--r--pydis_site/apps/api/tests/test_reminders.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/pydis_site/apps/api/tests/test_reminders.py b/pydis_site/apps/api/tests/test_reminders.py
index 5042ea90..a05d9296 100644
--- a/pydis_site/apps/api/tests/test_reminders.py
+++ b/pydis_site/apps/api/tests/test_reminders.py
@@ -4,7 +4,7 @@ from django.forms.models import model_to_dict
from django_hosts.resolvers import reverse
from .base import APISubdomainTestCase
-from ..models import Reminder, Role, User
+from ..models import Reminder, User
class UnauthedReminderAPITests(APISubdomainTestCase):
@@ -54,18 +54,6 @@ class ReminderCreationTests(APISubdomainTestCase):
name='Mermaid Man',
discriminator=1234,
)
- cls.user = User.objects.create(
- id=5678,
- name='Fish Dude',
- discriminator=5678,
- )
- cls.role = Role.objects.create(
- id=555,
- name="Random role",
- colour=2,
- permissions=0b01010010101,
- position=10,
- )
def test_accepts_valid_data(self):
data = {
@@ -74,7 +62,7 @@ class ReminderCreationTests(APISubdomainTestCase):
'expiration': datetime.utcnow().isoformat(),
'jump_url': "https://www.google.com",
'channel_id': 123,
- 'mentions': [self.user.id, self.role.id],
+ 'mentions': [8888, 9999],
}
url = reverse('bot:reminder-list', host='api')
response = self.client.post(url, data=data)