diff options
Diffstat (limited to 'pydis_site/apps/api/tests')
-rw-r--r-- | pydis_site/apps/api/tests/base.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_deleted_messages.py | 4 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_documentation_links.py | 4 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_infractions.py | 6 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_nominations.py | 4 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_off_topic_channel_names.py | 4 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_offensive_message.py | 6 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_roles.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_users.py | 4 |
9 files changed, 18 insertions, 18 deletions
diff --git a/pydis_site/apps/api/tests/base.py b/pydis_site/apps/api/tests/base.py index b779256e..61c23b0f 100644 --- a/pydis_site/apps/api/tests/base.py +++ b/pydis_site/apps/api/tests/base.py @@ -5,7 +5,7 @@ from rest_framework.test import APITestCase test_user, _created = User.objects.get_or_create( username='test', email='[email protected]', - password='testpass', # noqa + password='testpass', is_superuser=True, is_staff=True ) diff --git a/pydis_site/apps/api/tests/test_deleted_messages.py b/pydis_site/apps/api/tests/test_deleted_messages.py index b3a8197b..fb93cae6 100644 --- a/pydis_site/apps/api/tests/test_deleted_messages.py +++ b/pydis_site/apps/api/tests/test_deleted_messages.py @@ -8,7 +8,7 @@ from ..models import MessageDeletionContext, User class DeletedMessagesWithoutActorTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.author = User.objects.create( id=55, name='Robbie Rotten', @@ -49,7 +49,7 @@ class DeletedMessagesWithoutActorTests(APISubdomainTestCase): class DeletedMessagesWithActorTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.author = cls.actor = User.objects.create( id=12904, name='Joe Armstrong', diff --git a/pydis_site/apps/api/tests/test_documentation_links.py b/pydis_site/apps/api/tests/test_documentation_links.py index f6c78391..e560a2fd 100644 --- a/pydis_site/apps/api/tests/test_documentation_links.py +++ b/pydis_site/apps/api/tests/test_documentation_links.py @@ -57,7 +57,7 @@ class EmptyDatabaseDocumentationLinkAPITests(APISubdomainTestCase): class DetailLookupDocumentationLinkAPITests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.doc_link = DocumentationLink.objects.create( package='testpackage', base_url='https://example.com', @@ -141,7 +141,7 @@ class DocumentationLinkCreationTests(APISubdomainTestCase): class DocumentationLinkDeletionTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.doc_link = DocumentationLink.objects.create( package='example', base_url='https://example.com', diff --git a/pydis_site/apps/api/tests/test_infractions.py b/pydis_site/apps/api/tests/test_infractions.py index ca87026c..bc258b77 100644 --- a/pydis_site/apps/api/tests/test_infractions.py +++ b/pydis_site/apps/api/tests/test_infractions.py @@ -42,7 +42,7 @@ class UnauthenticatedTests(APISubdomainTestCase): class InfractionTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.user = User.objects.create( id=5, name='james', @@ -164,7 +164,7 @@ class InfractionTests(APISubdomainTestCase): class CreationTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.user = User.objects.create( id=5, name='james', @@ -517,7 +517,7 @@ class CreationTests(APISubdomainTestCase): class ExpandedTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.user = User.objects.create( id=5, name='james', diff --git a/pydis_site/apps/api/tests/test_nominations.py b/pydis_site/apps/api/tests/test_nominations.py index add5a7e4..76cb4112 100644 --- a/pydis_site/apps/api/tests/test_nominations.py +++ b/pydis_site/apps/api/tests/test_nominations.py @@ -8,7 +8,7 @@ from ..models import Nomination, User class CreationTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.user = User.objects.create( id=1234, name='joe dart', @@ -185,7 +185,7 @@ class CreationTests(APISubdomainTestCase): class NominationTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.user = User.objects.create( id=1234, name='joe dart', diff --git a/pydis_site/apps/api/tests/test_off_topic_channel_names.py b/pydis_site/apps/api/tests/test_off_topic_channel_names.py index 9ab71409..bd42cd81 100644 --- a/pydis_site/apps/api/tests/test_off_topic_channel_names.py +++ b/pydis_site/apps/api/tests/test_off_topic_channel_names.py @@ -58,7 +58,7 @@ class EmptyDatabaseTests(APISubdomainTestCase): class ListTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.test_name = OffTopicChannelName.objects.create(name='lemons-lemonade-stand') cls.test_name_2 = OffTopicChannelName.objects.create(name='bbq-with-bisk') @@ -129,7 +129,7 @@ class CreationTests(APISubdomainTestCase): class DeletionTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.test_name = OffTopicChannelName.objects.create(name='lemons-lemonade-stand') cls.test_name_2 = OffTopicChannelName.objects.create(name='bbq-with-bisk') diff --git a/pydis_site/apps/api/tests/test_offensive_message.py b/pydis_site/apps/api/tests/test_offensive_message.py index d5896714..0f3dbffa 100644 --- a/pydis_site/apps/api/tests/test_offensive_message.py +++ b/pydis_site/apps/api/tests/test_offensive_message.py @@ -71,7 +71,7 @@ class CreationTests(APISubdomainTestCase): class ListTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): delete_at = datetime.datetime.now() + datetime.timedelta(days=1) aware_delete_at = delete_at.replace(tzinfo=datetime.timezone.utc) @@ -110,7 +110,7 @@ class ListTests(APISubdomainTestCase): class DeletionTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): delete_at = datetime.datetime.now(tz=datetime.timezone.utc) + datetime.timedelta(days=1) cls.valid_offensive_message = OffensiveMessage.objects.create( @@ -134,7 +134,7 @@ class DeletionTests(APISubdomainTestCase): class NotAllowedMethodsTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): delete_at = datetime.datetime.now(tz=datetime.timezone.utc) + datetime.timedelta(days=1) cls.valid_offensive_message = OffensiveMessage.objects.create( diff --git a/pydis_site/apps/api/tests/test_roles.py b/pydis_site/apps/api/tests/test_roles.py index 0a6cea9e..4d1a430c 100644 --- a/pydis_site/apps/api/tests/test_roles.py +++ b/pydis_site/apps/api/tests/test_roles.py @@ -6,7 +6,7 @@ from ..models import Role class CreationTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.admins_role = Role.objects.create( id=1, name="Admins", diff --git a/pydis_site/apps/api/tests/test_users.py b/pydis_site/apps/api/tests/test_users.py index bbdd3ff4..86799f19 100644 --- a/pydis_site/apps/api/tests/test_users.py +++ b/pydis_site/apps/api/tests/test_users.py @@ -36,7 +36,7 @@ class UnauthedUserAPITests(APISubdomainTestCase): class CreationTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.role = Role.objects.create( id=5, name="Test role pls ignore", @@ -124,7 +124,7 @@ class CreationTests(APISubdomainTestCase): class UserModelTests(APISubdomainTestCase): @classmethod - def setUpTestData(cls): # noqa + def setUpTestData(cls): cls.role_top = Role.objects.create( id=777, name="High test role", |