mirror of
https://github.com/django/django.git
synced 2025-08-25 19:29:14 +00:00
Fixed failing bulk_create test raising IntegrityError when run in reverse.
When running the `bulk_create` tests with Postgres settings and `--reverse`, the following IntegrityError was raised in bulk_create.tests.BulkCreateTransactionTests.test_objs_with_and_without_pk: django.db.utils.IntegrityError: duplicate key value violates unique constraint "bulk_create_country_pkey" DETAIL: Key (id)=(1) already exists. This branch fixes this by ensuring the ID is unique since DB sequences are not resetted between tests.
This commit is contained in:
parent
aae7836cc0
commit
d6a8e5f5e1
@ -901,7 +901,7 @@ class BulkCreateTransactionTests(TransactionTestCase):
|
||||
with self.assertNumQueries(4):
|
||||
Country.objects.bulk_create(
|
||||
[
|
||||
Country(id=1, name="France", iso_two_letter="FR"),
|
||||
Country(id=10, name="France", iso_two_letter="FR"),
|
||||
Country(name="Canada", iso_two_letter="CA"),
|
||||
]
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user