kopia lustrzana https://github.com/wagtail/wagtail
Warm up cache to ensure that assertNumQueries assertions are consistent when tests are run in isolation
rodzic
69665ca6dd
commit
302a73e9d2
|
@ -1698,6 +1698,10 @@ class TestPageEdit(TestCase, WagtailTestUtils):
|
|||
)
|
||||
|
||||
def test_page_edit_num_queries(self):
|
||||
# Warm up cache so that result is the same when running this test in isolation
|
||||
# as when running it within the full test suite
|
||||
self.client.get(reverse("wagtailadmin_pages:edit", args=(self.event_page.id,)))
|
||||
|
||||
with self.assertNumQueries(40):
|
||||
self.client.get(
|
||||
reverse("wagtailadmin_pages:edit", args=(self.event_page.id,))
|
||||
|
|
|
@ -322,6 +322,10 @@ class TestImageIndexView(TestCase, WagtailTestUtils):
|
|||
)
|
||||
|
||||
def test_num_queries(self):
|
||||
# Warm up cache so that result is the same when running this test in isolation
|
||||
# as when running it within the full test suite.
|
||||
self.get()
|
||||
|
||||
# Initial number of queries.
|
||||
with self.assertNumQueries(13):
|
||||
self.get()
|
||||
|
|
Ładowanie…
Reference in New Issue