aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-08-09 10:44:13 -0700
committerGravatar MarkKoz <[email protected]>2019-09-21 10:38:40 -0700
commitb07e48321103bc60cb85b45bd0f07da3f1c083e5 (patch)
tree363a853bcd130614d977bbfbc1d6a8c804bad455
parentCI Job Merge (#255) (diff)
Add test for certain unicode characters in ot names
-rw-r--r--pydis_site/apps/api/tests/test_off_topic_channel_names.py17
1 files changed, 14 insertions, 3 deletions
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 60af1f62..ae839484 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
@@ -88,10 +88,21 @@ class CreationTests(APISubdomainTestCase):
super().setUp()
url = reverse('bot:offtopicchannelname-list', host='api')
- self.name = "lemonade-shop"
+ self.name = "abcdefghijklmnopqrstuvwxyz-0123456789"
response = self.client.post(f'{url}?name={self.name}')
self.assertEqual(response.status_code, 201)
+ def test_returns_201_for_unicode_chars(self):
+ url = reverse('bot:offtopicchannelname-list', host='api')
+ names = (
+ '𝖠𝖡𝖢𝖣𝖤𝖥𝖦𝖧𝖨𝖩𝖪𝖫𝖬𝖭𝖮𝖯𝖰𝖱𝖲𝖳𝖴𝖵𝖶𝖷𝖸𝖹',
+ 'ǃ?’',
+ )
+
+ for name in names:
+ response = self.client.post(f'{url}?name={name}')
+ self.assertEqual(response.status_code, 201)
+
def test_name_in_full_list(self):
url = reverse('bot:offtopicchannelname-list', host='api')
response = self.client.get(url)
@@ -111,8 +122,8 @@ class CreationTests(APISubdomainTestCase):
url = reverse('bot:offtopicchannelname-list', host='api')
invalid_names = (
'space between words',
- 'UPPERCASE',
- '$$$$$$$$'
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ '!?\'@#$%^&*()',
)
for name in invalid_names: