diff options
| author | Alex Hill <alex@hill.net.au> | 2015-08-04 00:34:19 +1000 |
|---|---|---|
| committer | Josh Smeaton <josh.smeaton@gmail.com> | 2015-09-22 23:35:24 +1000 |
| commit | 134ca4d438bd7cbe8f0f287a00d545f96fa04a01 (patch) | |
| tree | 075ce7ffcc95819a0584e80f6611462894faea0c /tests/model_fields | |
| parent | 6e51d5d0e531c6aead9ebd638a63ffdc32245e5a (diff) | |
Fixed #24509 -- Added Expression support to SQLInsertCompiler
Diffstat (limited to 'tests/model_fields')
| -rw-r--r-- | tests/model_fields/tests.py | 7 |
1 files changed, 6 insertions, 1 deletions
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, <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) |
