diff options
author | Gregory N. Schmit <schmitgreg@gmail.com> | 2018-12-21 01:24:04 -0600 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2019-02-07 19:56:47 -0500 |
commit | 48c17807a99f7a4341c74db19e16a37b010827c2 (patch) | |
tree | f5af98a18c850b96161b3c758fccf7eb7b617482 /tests/contenttypes_tests | |
parent | 5cc6f02f91e8860c867cc68cf42e66b5bb54c63d (diff) | |
download | django-48c17807a99f7a4341c74db19e16a37b010827c2.tar.gz |
Fixed #16027 -- Added app_label to ContentType.__str__().
Diffstat (limited to 'tests/contenttypes_tests')
-rw-r--r-- | tests/contenttypes_tests/test_models.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/contenttypes_tests/test_models.py b/tests/contenttypes_tests/test_models.py index 91fdf8340f..0554d13184 100644 --- a/tests/contenttypes_tests/test_models.py +++ b/tests/contenttypes_tests/test_models.py @@ -201,7 +201,15 @@ class ContentTypesTests(TestCase): def test_str(self): ct = ContentType.objects.get(app_label='contenttypes_tests', model='site') - self.assertEqual(str(ct), 'site') + self.assertEqual(str(ct), 'contenttypes_tests | 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_app_labeled_name_unknown_model(self): + ct = ContentType(app_label='contenttypes_tests', model='unknown') + self.assertEqual(ct.app_labeled_name, 'unknown') class TestRouter: |