From 3d538e3b5b323ecf73a110c2796f9d6ca67335d1 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Sun, 27 Oct 2024 11:56:11 +0100 Subject: [PATCH] Add test for migration of anchor-only link. --- tests/test_migrations.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/test_migrations.py b/tests/test_migrations.py index eb34fcd6..62816844 100644 --- a/tests/test_migrations.py +++ b/tests/test_migrations.py @@ -90,7 +90,13 @@ def prepare(self): Link.objects.create( template="default", name="My Link", - external_link="http://www.django-cms.com", + external_link="https://www.django-cms.com", + ), + Link.objects.create( + template="default", + name="My Link", + external_link="https://www.django-cms.com/", + anchor="some_id", ), Link.objects.create( template="default", @@ -102,8 +108,20 @@ def prepare(self): name="My Link", phone="+01 234 567 89", ), + Link.objects.create( + template="default", + name="My Link", + anchor="anchor", + ), + ] + self.urls = [ + "/en/my-page/#some_id", + "https://www.django-cms.com", + "https://www.django-cms.com/#some_id", + "mailto:test@email.com", + "tel:+0123456789", + "#anchor", ] - self.urls = ["/en/my-page/#some_id", "http://www.django-cms.com", "mailto:test@email.com", "tel:+0123456789"] def test_tags_migrated(self): Link = self.new_state.apps.get_model('djangocms_link', 'Link')