diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-06-25 11:23:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-25 11:23:26 +0200 |
| commit | 1e96de4f974acbdaa25ad4ba1894ea060213174e (patch) | |
| tree | ff75c89880aee214977aa65d36de8c9e57397af2 /tests/admin_utils/tests.py | |
| parent | fbe82f82555bc25dccb476c749ca062f0b522be3 (diff) | |
Added test for django.contrib.admin.utils.help_text_for_field().
Diffstat (limited to 'tests/admin_utils/tests.py')
| -rw-r--r-- | tests/admin_utils/tests.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/admin_utils/tests.py b/tests/admin_utils/tests.py index 8e50556c75..a7594deda8 100644 --- a/tests/admin_utils/tests.py +++ b/tests/admin_utils/tests.py @@ -6,7 +6,8 @@ from django.conf import settings from django.contrib.admin import helpers from django.contrib.admin.utils import ( NestedObjects, display_for_field, display_for_value, flatten, - flatten_fieldsets, label_for_field, lookup_field, quote, + flatten_fieldsets, help_text_for_field, label_for_field, lookup_field, + quote, ) from django.db import DEFAULT_DB_ALIAS, models from django.test import SimpleTestCase, TestCase, override_settings @@ -334,6 +335,16 @@ class UtilsTests(SimpleTestCase): 'property short description' ) + def test_help_text_for_field(self): + tests = [ + ('article', ''), + ('unknown', ''), + ('hist', 'History help text'), + ] + for name, help_text in tests: + with self.subTest(name=name): + self.assertEqual(help_text_for_field(name, Article), help_text) + def test_related_name(self): """ Regression test for #13963 |
