summaryrefslogtreecommitdiff
path: root/tests/contenttypes_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/contenttypes_tests')
-rw-r--r--tests/contenttypes_tests/test_models.py23
-rw-r--r--tests/contenttypes_tests/tests.py4
2 files changed, 12 insertions, 15 deletions
diff --git a/tests/contenttypes_tests/test_models.py b/tests/contenttypes_tests/test_models.py
index 18795f9633..cf0c188fa8 100644
--- a/tests/contenttypes_tests/test_models.py
+++ b/tests/contenttypes_tests/test_models.py
@@ -166,11 +166,10 @@ class ContentTypesTests(TestCase):
@override_settings(ALLOWED_HOSTS=['example.com'])
def test_shortcut_view(self):
"""
- Check that the shortcut view (used for the admin "view on site"
- functionality) returns a complete URL regardless of whether the sites
- framework is installed
+ The shortcut view (used for the admin "view on site" functionality)
+ returns a complete URL regardless of whether the sites framework is
+ installed.
"""
-
request = HttpRequest()
request.META = {
"SERVER_NAME": "Example.com",
@@ -192,10 +191,9 @@ class ContentTypesTests(TestCase):
def test_shortcut_view_without_get_absolute_url(self):
"""
- Check that the shortcut view (used for the admin "view on site"
- functionality) returns 404 when get_absolute_url is not defined.
+ The shortcut view (used for the admin "view on site" functionality)
+ returns 404 when get_absolute_url is not defined.
"""
-
request = HttpRequest()
request.META = {
"SERVER_NAME": "Example.com",
@@ -209,9 +207,8 @@ class ContentTypesTests(TestCase):
def test_shortcut_view_with_broken_get_absolute_url(self):
"""
- Check that the shortcut view does not catch an AttributeError raised
- by the model's get_absolute_url method.
- Refs #8997.
+ The shortcut view does not catch an AttributeError raised by
+ the model's get_absolute_url() method (#8997).
"""
request = HttpRequest()
request.META = {
@@ -226,9 +223,9 @@ class ContentTypesTests(TestCase):
def test_missing_model(self):
"""
- Ensures that displaying content types in admin (or anywhere) doesn't
- break on leftover content type records in the DB for which no model
- is defined anymore.
+ Displaying content types in admin (or anywhere) doesn't break on
+ leftover content type records in the DB for which no model is defined
+ anymore.
"""
ct = ContentType.objects.create(
app_label='contenttypes',
diff --git a/tests/contenttypes_tests/tests.py b/tests/contenttypes_tests/tests.py
index ef13d3f4bb..5845c02af6 100644
--- a/tests/contenttypes_tests/tests.py
+++ b/tests/contenttypes_tests/tests.py
@@ -466,8 +466,8 @@ class ContentTypesMultidbTestCase(TestCase):
def test_multidb(self):
"""
- Test that, when using multiple databases, we use the db_for_read (see
- #20401).
+ When using multiple databases, ContentType.objects.get_for_model() uses
+ db_for_read().
"""
ContentType.objects.clear_cache()