0001-lingo-check-num-queries-on-transaction-list-page-381.patch
tests/test_lingo_manager.py | ||
---|---|---|
4 | 4 | |
5 | 5 |
from django.contrib.auth.models import User |
6 | 6 |
from django.core.wsgi import get_wsgi_application |
7 |
from django.db import connection |
|
8 |
from django.test.utils import CaptureQueriesContext |
|
7 | 9 |
from django.utils.timezone import now |
8 | 10 |
from webtest import TestApp |
9 | 11 |
import pytest |
... | ... | |
211 | 213 |
amount=1+i).save() |
212 | 214 | |
213 | 215 |
app = login(app) |
214 |
resp = app.get('/manage/lingo/', status=200) |
|
216 |
with CaptureQueriesContext(connection) as ctx: |
|
217 |
resp = app.get('/manage/lingo/', status=200) |
|
215 | 218 |
assert resp.text.count('<tr') == 11 |
219 |
assert len(ctx.captured_queries) == 74 |
|
216 | 220 | |
217 | 221 |
resp.form['q'] = 'order id 16' |
218 | 222 |
resp = resp.form.submit() |
219 |
- |