mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Used assertRaisesMessage() to test Django's error messages.
This commit is contained in:
parent
38988f289f
commit
a51c4de194
69 changed files with 448 additions and 173 deletions
|
@ -108,7 +108,8 @@ class BulkCreateTests(TestCase):
|
|||
"""
|
||||
valid_country = Country(name='Germany', iso_two_letter='DE')
|
||||
invalid_country = Country(id=0, name='Poland', iso_two_letter='PL')
|
||||
with self.assertRaises(ValueError):
|
||||
msg = 'The database backend does not accept 0 as a value for AutoField.'
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
Country.objects.bulk_create([valid_country, invalid_country])
|
||||
|
||||
def test_batch_same_vals(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue