mirror of
https://github.com/django/django.git
synced 2025-08-30 07:17:49 +00:00
Fixed #24509 -- Added Expression support to SQLInsertCompiler
This commit is contained in:
parent
6e51d5d0e5
commit
134ca4d438
15 changed files with 247 additions and 67 deletions
|
@ -98,8 +98,13 @@ class BasicFieldTests(test.TestCase):
|
|||
self.assertTrue(instance.id)
|
||||
# Set field to object on saved instance
|
||||
instance.size = instance
|
||||
msg = (
|
||||
"Tried to update field model_fields.FloatModel.size with a model "
|
||||
"instance, <FloatModel: FloatModel object>. Use a value "
|
||||
"compatible with FloatField."
|
||||
)
|
||||
with transaction.atomic():
|
||||
with self.assertRaises(TypeError):
|
||||
with self.assertRaisesMessage(TypeError, msg):
|
||||
instance.save()
|
||||
# Try setting field to object on retrieved object
|
||||
obj = FloatModel.objects.get(pk=instance.id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue