summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEtienne Chové <chove@crans.org>2019-02-28 08:49:17 +0100
committerTim Graham <timograham@gmail.com>2019-02-28 11:12:30 -0500
commit4dcbe6eb2de38a856dae39928692e46fbcf5c475 (patch)
treeb3a60320b43caf1c694c032a24db3c8dfe624c5e /tests
parent25e724a5d6e331d2d73050d6dcdf2e8593c3aebf (diff)
Fixed #30221 -- Made label suffix of admin's read-only fields translatable.
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_views/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 0cc16509ff..3acbc3d7ed 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -4961,6 +4961,13 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
self.assertNotContains(response, "<a>evil</a>", status_code=200)
self.assertContains(response, "&lt;a&gt;evil&lt;/a&gt;", status_code=200)
+ def test_label_suffix_translated(self):
+ pizza = Pizza.objects.create(name='Americano')
+ url = reverse('admin:admin_views_pizza_change', args=(pizza.pk,))
+ with self.settings(LANGUAGE_CODE='fr'):
+ response = self.client.get(url)
+ self.assertContains(response, '<label>Toppings\u00A0:</label>', html=True)
+
@override_settings(ROOT_URLCONF='admin_views.urls')
class LimitChoicesToInAdminTest(TestCase):