summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauréline Guérin <zebuline@entrouvert.com>2019-12-02 09:49:00 (GMT)
committerLauréline Guérin <zebuline@entrouvert.com>2019-12-20 09:45:50 (GMT)
commit93f8357f4f134f343f4c5444055b6abc4df0b1af (patch)
tree301675366b8db475d7cffd89e56e9b15a8ae5ae0
parentac3b6c3d10e7ab24bb151b1c365386218be376a3 (diff)
downloadcombo-93f8357f4f134f343f4c5444055b6abc4df0b1af.zip
combo-93f8357f4f134f343f4c5444055b6abc4df0b1af.tar.gz
combo-93f8357f4f134f343f4c5444055b6abc4df0b1af.tar.bz2
lingo: check num queries on transaction list page (#38115)
-rw-r--r--tests/test_lingo_manager.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_lingo_manager.py b/tests/test_lingo_manager.py
index 2c7769c..3c3856f 100644
--- a/tests/test_lingo_manager.py
+++ b/tests/test_lingo_manager.py
@@ -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()