tests: visit actions that are not available by default
This commit is contained in:
parent
5a9177b5d9
commit
c8044b9aea
|
@ -2271,6 +2271,13 @@ def test_workflows_check_available_actions(pub):
|
|||
|
||||
assert not 'Criticality Levels' in [x[0] for x in resp.forms[0]['action-formdata-action'].options]
|
||||
assert not 'SMS' in [x[0] for x in resp.forms[0]['action-interaction'].options]
|
||||
assert not 'User Notification' in [x[0] for x in resp.forms[0]['action-interaction'].options]
|
||||
|
||||
if not pub.site_options.has_section('variables'):
|
||||
pub.site_options.add_section('variables')
|
||||
pub.site_options.set('variables', 'portal_url', 'https://www.example.net/')
|
||||
with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd:
|
||||
pub.site_options.write(fd)
|
||||
|
||||
pub.cfg['sms'] = {'mode': 'foobar'}
|
||||
pub.write_cfg()
|
||||
|
@ -2280,6 +2287,21 @@ def test_workflows_check_available_actions(pub):
|
|||
resp = resp.click('baz')
|
||||
assert 'Criticality Levels' in [x[0] for x in resp.forms[0]['action-formdata-action'].options]
|
||||
assert 'SMS' in [x[0] for x in resp.forms[0]['action-interaction'].options]
|
||||
assert 'User Notification' in [x[0] for x in resp.forms[0]['action-interaction'].options]
|
||||
|
||||
for action in ('Criticality Levels', 'SMS', 'User Notification'):
|
||||
for category in ('status-change', 'interaction', 'formdata-action', 'user-action'):
|
||||
if action in [x[0] for x in resp.forms[0]['action-%s' % category].options if x[0]]:
|
||||
resp.forms[0]['action-%s' % category] = action
|
||||
resp = resp.forms[0].submit()
|
||||
resp = resp.follow()
|
||||
|
||||
for i in range(3):
|
||||
resp = resp.click('Edit', href='items/%d/' % (i+1), index=0)
|
||||
resp = resp.forms[0].submit('cancel')
|
||||
resp = resp.follow() # redirect to items/
|
||||
resp = resp.follow() # redirect to ./
|
||||
|
||||
|
||||
def test_workflows_edit_dispatch_action(pub):
|
||||
create_superuser(pub)
|
||||
|
|
Loading…
Reference in New Issue