mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #29559 -- Fixed TransactionTestCase.reset_sequences for auto-created m2m through models.
This commit is contained in:
parent
4d98b9d729
commit
a07a49ee32
3 changed files with 5 additions and 1 deletions
|
@ -342,6 +342,9 @@ class AutoIncrementResetTest(TransactionTestCase):
|
|||
# Regular model
|
||||
p = Person.objects.create(first_name='Jack', last_name='Smith')
|
||||
self.assertEqual(p.pk, 1)
|
||||
# Auto-created many-to-many through model
|
||||
p.friends.add(Person.objects.create(first_name='Jacky', last_name='Smith'))
|
||||
self.assertEqual(p.friends.through.objects.first().pk, 1)
|
||||
# Many-to-many through model
|
||||
b = B.objects.create()
|
||||
t = Through.objects.create(person=p, b=b)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue