Fixed #24509 -- Added Expression support to SQLInsertCompiler

This commit is contained in:
Alex Hill 2015-08-04 00:34:19 +10:00 committed by Josh Smeaton
parent 6e51d5d0e5
commit 134ca4d438
15 changed files with 247 additions and 67 deletions

View file

@ -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)