From 134ca4d438bd7cbe8f0f287a00d545f96fa04a01 Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Tue, 4 Aug 2015 00:34:19 +1000 Subject: Fixed #24509 -- Added Expression support to SQLInsertCompiler --- tests/model_fields/tests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/model_fields') diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 3d791980ba..23e90cccb8 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -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, . 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) -- cgit v1.3