mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-16 22:20:24 +00:00
Fix nested object test
This commit is contained in:
parent
77fd9401bb
commit
5bd01187d4
1 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from django.db import DEFAULT_DB_ALIAS
|
||||
from django.db import DEFAULT_DB_ALIAS, router
|
||||
from django.test import TestCase
|
||||
|
||||
from djadmin2.utils import NestedObjects
|
||||
|
|
@ -66,7 +66,8 @@ class NestedObjectsTests(TestCase):
|
|||
Check that the nested collector doesn't query for DO_NOTHING objects.
|
||||
"""
|
||||
objs = [Event.objects.create()]
|
||||
n = NestedObjects(using=None)
|
||||
using = router.db_for_write(Event._meta.model)
|
||||
n = NestedObjects(using=using)
|
||||
EventGuide.objects.create(event=objs[0])
|
||||
with self.assertNumQueries(2):
|
||||
# One for Location, one for Guest, and no query for EventGuide
|
||||
|
|
|
|||
Loading…
Reference in a new issue