diff --git a/django/contrib/contenttypes/models.py b/django/contrib/contenttypes/models.py
index 1bb07e0..d03f770 100644
a
|
b
|
def get_by_natural_key(self, app_label, model):
|
17 | 17 | |
18 | 18 | def _get_opts(self, model): |
19 | 19 | opts = model._meta |
20 | | while opts.proxy: |
21 | | model = opts.proxy_for_model |
22 | | opts = model._meta |
| 20 | if model._deferred: |
| 21 | opts = opts.proxy_for_model._meta |
23 | 22 | return opts |
24 | 23 | |
25 | 24 | def _get_from_cache(self, opts): |
diff --git a/tests/modeltests/proxy_models/tests.py b/tests/modeltests/proxy_models/tests.py
index 3ec8465..04ea203 100644
a
|
b
|
def _handler(*args, **kwargs):
|
217 | 217 | signals.post_save.disconnect(h6, sender=MyPersonProxy) |
218 | 218 | |
219 | 219 | def test_content_type(self): |
| 220 | # A model and a proxy of this model do not |
| 221 | # share the same ContentType see #17648 |
220 | 222 | ctype = ContentType.objects.get_for_model |
221 | | self.assertTrue(ctype(Person) is ctype(OtherPerson)) |
| 223 | self.assertFalse(ctype(Person) is ctype(OtherPerson)) |
222 | 224 | |
223 | 225 | def test_user_userproxy_userproxyproxy(self): |
224 | 226 | User.objects.create(name='Bruce') |