|
@@ -40,17 +40,17 @@ class TestSaveLoad(TestCase):
|
|
|
self.assertIsNone(loaded.field)
|
|
|
|
|
|
def test_pk_validated(self):
|
|
|
- with self.assertRaisesMessage(TypeError, 'is not a valid UUID'):
|
|
|
+ with self.assertRaisesMessage(exceptions.ValidationError, 'is not a valid UUID'):
|
|
|
PrimaryKeyUUIDModel.objects.get(pk={})
|
|
|
|
|
|
- with self.assertRaisesMessage(TypeError, 'is not a valid UUID'):
|
|
|
+ with self.assertRaisesMessage(exceptions.ValidationError, 'is not a valid UUID'):
|
|
|
PrimaryKeyUUIDModel.objects.get(pk=[])
|
|
|
|
|
|
def test_wrong_value(self):
|
|
|
- with self.assertRaisesMessage(ValueError, 'badly formed hexadecimal UUID string'):
|
|
|
+ with self.assertRaisesMessage(exceptions.ValidationError, 'is not a valid UUID'):
|
|
|
UUIDModel.objects.get(field='not-a-uuid')
|
|
|
|
|
|
- with self.assertRaisesMessage(ValueError, 'badly formed hexadecimal UUID string'):
|
|
|
+ with self.assertRaisesMessage(exceptions.ValidationError, 'is not a valid UUID'):
|
|
|
UUIDModel.objects.create(field='not-a-uuid')
|
|
|
|
|
|
|