summaryrefslogtreecommitdiff
path: root/tests/flatpages_tests
diff options
context:
space:
mode:
authorTom Carrick <knyght@knyg.ht>2018-09-09 12:35:44 +0100
committerTim Graham <timograham@gmail.com>2018-09-11 12:15:22 -0400
commita43cfc23d44abf6a3fe08e04117d67f7ab5d57bf (patch)
tree1300a25e8a040db41d611b2ff9c3f46f14f3f128 /tests/flatpages_tests
parent5195b99e2c3804ec5f9c98d29e0cf76bf44b0cec (diff)
Fixed #29746 -- Fixed misleading FlatpageForm URL help text if APPEND_SLASH is disabled.
Diffstat (limited to 'tests/flatpages_tests')
-rw-r--r--tests/flatpages_tests/test_forms.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/flatpages_tests/test_forms.py b/tests/flatpages_tests/test_forms.py
index 2a4bb0679a..ce9bf449ce 100644
--- a/tests/flatpages_tests/test_forms.py
+++ b/tests/flatpages_tests/test_forms.py
@@ -49,6 +49,11 @@ class FlatpageAdminFormTests(TestCase):
def test_flatpage_requires_trailing_slash_with_append_slash(self):
form = FlatpageForm(data=dict(url='/no_trailing_slash', **self.form_data))
with translation.override('en'):
+ self.assertEqual(
+ form.fields['url'].help_text,
+ "Example: '/about/contact/'. Make sure to have leading and "
+ "trailing slashes."
+ )
self.assertFalse(form.is_valid())
self.assertEqual(form.errors['url'], ["URL is missing a trailing slash."])
@@ -56,6 +61,11 @@ class FlatpageAdminFormTests(TestCase):
def test_flatpage_doesnt_requires_trailing_slash_without_append_slash(self):
form = FlatpageForm(data=dict(url='/no_trailing_slash', **self.form_data))
self.assertTrue(form.is_valid())
+ with translation.override('en'):
+ self.assertEqual(
+ form.fields['url'].help_text,
+ "Example: '/about/contact'. Make sure to have a leading slash."
+ )
def test_flatpage_admin_form_url_uniqueness_validation(self):
"The flatpage admin form correctly enforces url uniqueness among flatpages of the same site"