lingo: check num queries on transaction list page (#38115)

This commit is contained in:
Lauréline Guérin 2019-12-02 10:49:00 +01:00
parent ac3b6c3d10
commit 93f8357f4f
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,8 @@
import datetime
from django.contrib.auth.models import User
from django.db import connection
from django.test.utils import CaptureQueriesContext
from django.utils.timezone import now
import mock
@ -211,8 +213,10 @@ def test_transactions_search(app, admin_user):
amount=1+i).save()
app = login(app)
resp = app.get('/manage/lingo/', status=200)
with CaptureQueriesContext(connection) as ctx:
resp = app.get('/manage/lingo/', status=200)
assert resp.text.count('<tr') == 11
assert len(ctx.captured_queries) == 74
resp.form['q'] = 'order id 16'
resp = resp.form.submit()