tests: factorize get_table
This commit is contained in:
parent
e9a4301542
commit
a1d572dbf8
|
@ -1,16 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from utils import login
|
||||
from utils import login, get_table
|
||||
|
||||
def get_table(response):
|
||||
table = []
|
||||
|
||||
for tr in response.pyquery('table tr'):
|
||||
row = []
|
||||
table.append(row)
|
||||
for td in tr.findall('td'):
|
||||
row.append(td.text.strip())
|
||||
return table
|
||||
|
||||
def test_simple(schema1, app, admin):
|
||||
login(app, admin)
|
||||
|
|
|
@ -18,3 +18,14 @@ def login(app, user, path=None, password=None):
|
|||
assert str(app.session['_auth_user_id']) == str(user.id)
|
||||
return response
|
||||
|
||||
|
||||
def get_table(response):
|
||||
table = []
|
||||
|
||||
for tr in response.pyquery('table tr'):
|
||||
row = []
|
||||
table.append(row)
|
||||
for td in tr.findall('td'):
|
||||
row.append(td.text.strip())
|
||||
return table
|
||||
|
||||
|
|
Loading…
Reference in New Issue