summaryrefslogtreecommitdiff
path: root/tests/contenttypes_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-09-03 14:57:57 -0400
committerTim Graham <timograham@gmail.com>2015-09-23 19:31:10 -0400
commit75374d3797c2cd2423982a870bb0bc74821e951f (patch)
tree33d0560200ea93e2c96704a05c7a207c4a8ba12f /tests/contenttypes_tests
parenta3fe4addcb9063fc327c8609c7ebba4d531da4ce (diff)
Refs #24099 -- Removed compatibility shim for ContentType.name field.
Diffstat (limited to 'tests/contenttypes_tests')
-rw-r--r--tests/contenttypes_tests/test_models.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/tests/contenttypes_tests/test_models.py b/tests/contenttypes_tests/test_models.py
index eb436b6a64..37e0b93048 100644
--- a/tests/contenttypes_tests/test_models.py
+++ b/tests/contenttypes_tests/test_models.py
@@ -1,7 +1,5 @@
from __future__ import unicode_literals
-import warnings
-
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.shortcuts import get_current_site
@@ -247,25 +245,6 @@ class ContentTypesTests(TestCase):
ct_fetched = ContentType.objects.get_for_id(ct.pk)
self.assertIsNone(ct_fetched.model_class())
- def test_name_deprecation(self):
- """
- ContentType.name has been removed. Test that a warning is emitted when
- creating a ContentType with a `name`, but the creation should not fail.
- """
- with warnings.catch_warnings(record=True) as warns:
- warnings.simplefilter('always')
- ContentType.objects.create(
- name='Name',
- app_label='contenttypes',
- model='OldModel',
- )
- self.assertEqual(len(warns), 1)
- self.assertEqual(
- str(warns[0].message),
- "ContentType.name field doesn't exist any longer. Please remove it from your code."
- )
- self.assertTrue(ContentType.objects.filter(model='OldModel').exists())
-
@mock.patch('django.contrib.contenttypes.models.ContentTypeManager.get_or_create')
@mock.patch('django.contrib.contenttypes.models.ContentTypeManager.get')
def test_message_if_get_for_model_fails(self, mocked_get, mocked_get_or_create):