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

@ -1212,9 +1212,8 @@ class OtherModelTests(SimpleTestCase):
class Model(models.Model):
fk = models.ForeignKey('self', models.CASCADE)
@property
def fk_id(self):
pass
# Override related field accessor.
Model.fk_id = property(lambda self: 'ERROR')
self.assertEqual(Model.check(), [
Error(