0001-workflows-don-t-include-in-listing-option-for-displa.patch
tests/test_admin_pages.py | ||
---|---|---|
1556 | 1556 |
resp = resp.form.submit('submit') |
1557 | 1557 |
assert 'error in template' in resp.body and 'unmatched [end]' in resp.body |
1558 | 1558 | |
1559 |
def test_workflows_edit_display_form_action(pub): |
|
1560 |
create_superuser(pub) |
|
1561 |
role = create_role() |
|
1562 |
Workflow.wipe() |
|
1563 |
workflow = Workflow(name='foo') |
|
1564 |
workflow.add_status(name='baz') |
|
1565 |
workflow.store() |
|
1566 | ||
1567 |
app = login(get_app(pub)) |
|
1568 |
resp = app.get('/backoffice/workflows/1/') |
|
1569 |
resp = resp.click('baz') |
|
1570 | ||
1571 |
resp.forms[0]['type'] = 'Display a form' |
|
1572 |
resp = resp.forms[0].submit() |
|
1573 |
resp = resp.follow() |
|
1574 | ||
1575 |
resp = resp.click('Display a form') |
|
1576 |
resp = resp.click('Edit Fields') |
|
1577 | ||
1578 |
resp.form['label'] = 'foobar' |
|
1579 |
resp.form['type'] = 'Text (line)' |
|
1580 |
resp = resp.form.submit() |
|
1581 | ||
1582 |
resp = resp.follow() |
|
1583 |
assert 'foobar' in resp.body |
|
1584 |
resp = resp.click('Edit') |
|
1585 |
assert not 'in_listing' in resp.form.fields.keys() |
|
1559 | 1586 | |
1560 | 1587 |
def test_workflows_variables(pub): |
1561 | 1588 |
create_superuser(pub) |
wcs/wf/form.py | ||
---|---|---|
50 | 50 |
def store(self): |
51 | 51 |
self.item.parent.parent.store() |
52 | 52 | |
53 | ||
53 | 54 |
class WorkflowFormFieldDefPage(FieldDefPage): |
54 | 55 |
section = 'workflows' |
55 | 56 | |
57 |
def form(self): |
|
58 |
form = super(WorkflowFormFieldDefPage, self).form() |
|
59 |
form.remove('in_listing') |
|
60 |
return form |
|
61 | ||
56 | 62 | |
57 | 63 |
class WorkflowFormFieldsDirectory(FieldsDirectory): |
58 | 64 |
section = 'workflows' |
59 | 65 |
support_import = False |
60 | 66 |
blacklisted_types = ['page'] |
67 |
field_def_page_class = WorkflowFormFieldDefPage |
|
61 | 68 | |
62 | 69 | |
63 | 70 |
class FormWorkflowStatusItem(WorkflowStatusItem): |
64 |
- |