summaryrefslogtreecommitdiff
path: root/tests/contenttypes_tests
diff options
context:
space:
mode:
authorMarcelo Galigniana <marcelogaligniana@gmail.com>2022-10-11 00:38:39 -0300
committerGitHub <noreply@github.com>2022-10-11 05:38:39 +0200
commitf30c7e381c94f41d361877d8a3e90f8cfb391709 (patch)
treec4db6923fc9936a98f76807547add8b458b435f6 /tests/contenttypes_tests
parentda8fa764134980ee1079f790cda6616f32cf9c44 (diff)
downloaddjango-f30c7e381c94f41d361877d8a3e90f8cfb391709.tar.gz
Completed test coverage for contenttypes models.
Diffstat (limited to 'tests/contenttypes_tests')
-rw-r--r--tests/contenttypes_tests/test_models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/contenttypes_tests/test_models.py b/tests/contenttypes_tests/test_models.py
index d0aa08dd22..2b346b0e44 100644
--- a/tests/contenttypes_tests/test_models.py
+++ b/tests/contenttypes_tests/test_models.py
@@ -282,10 +282,18 @@ class ContentTypesTests(TestCase):
ct = ContentType.objects.get(app_label="contenttypes_tests", model="site")
self.assertEqual(str(ct), "contenttypes_tests | site")
+ def test_name(self):
+ ct = ContentType.objects.get(app_label="contenttypes_tests", model="site")
+ self.assertEqual(ct.name, "site")
+
def test_app_labeled_name(self):
ct = ContentType.objects.get(app_label="contenttypes_tests", model="site")
self.assertEqual(ct.app_labeled_name, "contenttypes_tests | site")
+ def test_name_unknown_model(self):
+ ct = ContentType(app_label="contenttypes_tests", model="unknown")
+ self.assertEqual(ct.name, "unknown")
+
def test_app_labeled_name_unknown_model(self):
ct = ContentType(app_label="contenttypes_tests", model="unknown")
self.assertEqual(ct.app_labeled_name, "unknown")