1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #30427, Fixed #16176 -- Corrected setting descriptor in Field.contribute_to_class().

Co-authored-by: Jarek Glowacki <jarekwg@gmail.com>
This commit is contained in:
Carlton Gibson
2021-06-09 16:55:22 +02:00
parent 0c0240aba8
commit 225d96533a
8 changed files with 112 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ from django.test import TestCase
from .models import (
BigChild, Child, ChildProxy, Primary, RefreshPrimaryProxy, Secondary,
ShadowChild,
)
@@ -165,6 +166,11 @@ class DeferTests(AssertionMixin, TestCase):
self.assertEqual(obj.name, "c1")
self.assertEqual(obj.value, "foo")
def test_defer_of_overridden_scalar(self):
ShadowChild.objects.create()
obj = ShadowChild.objects.defer('name').get()
self.assertEqual(obj.name, 'adonis')
class BigChildDeferTests(AssertionMixin, TestCase):
@classmethod