tests: deal with changing identifiers in backoffice tests

This commit is contained in:
Frédéric Péters 2015-03-20 11:46:46 +01:00
parent 136ade48b0
commit 596838802d
1 changed files with 4 additions and 3 deletions

View File

@ -214,14 +214,15 @@ def test_backoffice_handling(pub):
create_superuser(pub)
create_environment()
form_class = FormDef.get_by_urlname('form-title').data_class()
number31 = [x for x in form_class.select() if x.data['1'] == 'FOO BAR 30'][0].id
app = login(get_app(pub))
resp = app.get('/backoffice/form-title/')
resp = resp.click(href='31/')
assert ' with the number 31.' in resp.body
resp = resp.click(href='%s/' % number31)
assert (' with the number %s.' % number31) in resp.body
resp.forms[0]['comment'] = 'HELLO WORLD'
resp = resp.forms[0].submit('button_accept')
resp = resp.follow()
assert FormDef.get_by_urlname('form-title').data_class().get(31).status == 'wf-accepted'
assert FormDef.get_by_urlname('form-title').data_class().get(number31).status == 'wf-accepted'
assert 'HELLO WORLD' in resp.body
def test_global_statisticspub(pub):