diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/defer/models.py | 4 | ||||
| -rw-r--r-- | tests/modeltests/defer/tests.py | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/modeltests/defer/models.py b/tests/modeltests/defer/models.py index 4fddd39d26..c64becf972 100644 --- a/tests/modeltests/defer/models.py +++ b/tests/modeltests/defer/models.py @@ -22,3 +22,7 @@ class Child(Primary): class BigChild(Primary): other = models.CharField(max_length=50) + +class ChildProxy(Child): + class Meta: + proxy=True diff --git a/tests/modeltests/defer/tests.py b/tests/modeltests/defer/tests.py index 542162c3b2..88aac0c9e5 100644 --- a/tests/modeltests/defer/tests.py +++ b/tests/modeltests/defer/tests.py @@ -3,7 +3,7 @@ from __future__ import absolute_import from django.db.models.query_utils import DeferredAttribute from django.test import TestCase -from .models import Secondary, Primary, Child, BigChild +from .models import Secondary, Primary, Child, BigChild, ChildProxy class DeferTests(TestCase): @@ -145,3 +145,7 @@ class DeferTests(TestCase): obj.name = "bb" obj.save() + def test_defer_proxy(self): + # using select related and only should not result in Exception + for obj in ChildProxy.objects.all().select_related().only('id'): + continue |
