diff --git a/tom_common/tests.py b/tom_common/tests.py index dae42f6c..7c85430b 100644 --- a/tom_common/tests.py +++ b/tom_common/tests.py @@ -9,6 +9,7 @@ from django_comments.models import Comment from tom_targets.tests.factories import SiderealTargetFactory +from tom_common.templatetags.tom_common_extras import * class TestCommonViews(TestCase): @@ -26,6 +27,17 @@ def test_index(self): self.assertEqual(response.status_code, 200) +class TestCommonExtras(TestCase): + def setUp(self): + pass + + def test_verbose_name(self): + # Check that the verbose name for a model field is returned correctly + self.assertEqual(verbose_name(User, 'email'), 'Email Address') + # Check that the verbose name for a non-existent field is returned correctly + self.assertEqual(verbose_name(User, 'definitely_not_a_field'), 'Definitely_Not_A_Field') + + class TestUserManagement(TestCase): def setUp(self): self.admin = User.objects.create_superuser(username='admin', password='admin', email='test@example.com')