summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_fields')
-rw-r--r--tests/model_fields/test_uuid.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/model_fields/test_uuid.py b/tests/model_fields/test_uuid.py
index 5cded8d6af..050075444e 100644
--- a/tests/model_fields/test_uuid.py
+++ b/tests/model_fields/test_uuid.py
@@ -47,13 +47,11 @@ class TestSaveLoad(TestCase):
PrimaryKeyUUIDModel.objects.get(pk=[])
def test_wrong_value(self):
- self.assertRaisesMessage(
- ValueError, 'badly formed hexadecimal UUID string',
- UUIDModel.objects.get, field='not-a-uuid')
+ with self.assertRaisesMessage(ValueError, 'badly formed hexadecimal UUID string'):
+ UUIDModel.objects.get(field='not-a-uuid')
- self.assertRaisesMessage(
- ValueError, 'badly formed hexadecimal UUID string',
- UUIDModel.objects.create, field='not-a-uuid')
+ with self.assertRaisesMessage(ValueError, 'badly formed hexadecimal UUID string'):
+ UUIDModel.objects.create(field='not-a-uuid')
class TestMigrations(SimpleTestCase):