fix(applications): accept VK domains without protocol
This commit is contained in:
1 parent
e5bd31b428
commit
12e9de9ba4
4 files changed
+25
-3
No files matched your search
@@ -17,6 +17,16 @@ class ApplicationTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ApplicationError, "прошлой практики"):
|
||||
validate_application({"type": "flying_squirrel", "name": "Муся", "character_id": 1337, "practiced_before": True})
|
||||
|
||||
def test_vk_link_accepts_a_domain_without_protocol(self) -> None:
|
||||
for link in ("vk.com", "vk.ru", "https://vk.com", "https://vk.ru"):
|
||||
with self.subTest(link=link):
|
||||
application = validate_application({
|
||||
"type": "flying_squirrel", "name": "Муся", "character_id": 1337,
|
||||
"practiced_before": False, "vk_link": link,
|
||||
})
|
||||
expected = link if link.startswith("https://") else f"https://{link}"
|
||||
self.assertEqual(application["vk_link"], expected)
|
||||
|
||||
def test_feather_donation_is_saved_and_accepted(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
store = ApplicationStore(sqlite_path=Path(directory) / "applications.sqlite3")
|
||||
|
||||
Reference in new issue
Block a user