0001-management-add-link-to-form-carddef-page-in-sidebar-.patch
tests/backoffice_pages/test_all.py | ||
---|---|---|
331 | 331 |
assert resp.pyquery.find('body.section-management') |
332 | 332 | |
333 | 333 | |
334 |
def test_admin_form_page(pub): |
|
335 |
create_superuser(pub) |
|
336 |
FormDef.wipe() |
|
337 |
formdef = FormDef() |
|
338 |
formdef.name = 'form title' |
|
339 |
formdef.fields = [] |
|
340 |
formdef.store() |
|
341 | ||
342 |
app = login(get_app(pub)) |
|
343 |
resp = app.get('/backoffice/management/form-title/') |
|
344 |
assert 'backoffice/forms/1/' in resp |
|
345 | ||
346 | ||
334 | 347 |
def test_backoffice_listing(pub): |
335 | 348 |
create_superuser(pub) |
336 | 349 |
create_environment(pub) |
... | ... | |
5374 | 5387 |
resp = app.get(create_formdata['source_formdef'].get_url(backoffice=True)) |
5375 | 5388 | |
5376 | 5389 |
# click on first available formdata |
5377 |
resp = resp.click(href='%s/' % formdata.id)
|
|
5390 |
resp = resp.click('%s-%s' % (create_formdata['source_formdef'].id, formdata.id))
|
|
5378 | 5391 |
target_data_class = create_formdata['target_formdef'].data_class() |
5379 | 5392 |
assert target_data_class.count() == 0 |
5380 | 5393 |
# resubmit it through backoffice submission |
... | ... | |
5492 | 5505 |
resp = app.get(create_formdata['source_formdef'].get_url(backoffice=True)) |
5493 | 5506 | |
5494 | 5507 |
# click on first available formdata |
5495 |
resp = resp.click(href='%s/' % formdata.id)
|
|
5508 |
resp = resp.click('%s-%s' % (create_formdata['source_formdef'].id, formdata.id))
|
|
5496 | 5509 |
target_data_class = create_formdata['target_formdef'].data_class() |
5497 | 5510 |
assert target_data_class.count() == 0 |
5498 | 5511 |
# resubmit it through backoffice submission |
tests/backoffice_pages/test_carddata.py | ||
---|---|---|
15 | 15 |
from wcs.workflows import ChoiceWorkflowStatusItem, Workflow |
16 | 16 | |
17 | 17 |
from ..utilities import clean_temporary_pub, create_temporary_pub, get_app, login |
18 |
from .test_all import create_user |
|
18 |
from .test_all import create_superuser, create_user
|
|
19 | 19 | |
20 | 20 | |
21 | 21 |
def pytest_generate_tests(metafunc): |
... | ... | |
47 | 47 |
clean_temporary_pub() |
48 | 48 | |
49 | 49 | |
50 |
def test_admin_card_page(pub): |
|
51 |
create_superuser(pub) |
|
52 |
CardDef.wipe() |
|
53 |
carddef = CardDef() |
|
54 |
carddef.name = 'foo' |
|
55 |
carddef.fields = [] |
|
56 |
carddef.store() |
|
57 | ||
58 |
app = login(get_app(pub)) |
|
59 |
resp = app.get('/backoffice/data/foo/') |
|
60 |
assert 'backoffice/cards/1/' in resp |
|
61 | ||
62 | ||
50 | 63 |
def test_carddata_management(pub): |
51 | 64 |
CardDef.wipe() |
52 | 65 |
user = create_user(pub) |
wcs/backoffice/data_management.py | ||
---|---|---|
103 | 103 |
admin_permission = 'cards' |
104 | 104 |
formdef_class = CardDef |
105 | 105 |
search_label = _('Search in card content') |
106 |
formdef_view_label = _('Card Model page') |
|
106 | 107 | |
107 | 108 |
@property |
108 | 109 |
def add(self): |
wcs/backoffice/management.py | ||
---|---|---|
791 | 791 |
admin_permission = 'forms' |
792 | 792 |
formdef_class = FormDef |
793 | 793 |
search_label = _('Search in form content') |
794 |
formdef_view_label = _('Form page') |
|
794 | 795 |
WCS_SYNC_EXPORT_LIMIT = 100 # Arbitrary threshold |
795 | 796 | |
796 | 797 |
def __init__(self, component=None, formdef=None, view=None, update_breadcrumbs=True): |
... | ... | |
874 | 875 |
or self.formdef.category.has_permission('statistics', get_request().user) |
875 | 876 |
): |
876 | 877 |
r += htmltext(' <li class="stats"><a href="stats">%s</a></li>') % _('Statistics') |
878 | ||
879 |
if get_publisher().get_backoffice_root().is_global_accessible(self.formdef.backoffice_section): |
|
880 |
r += htmltext(' <li><a href="%s">%s</a></li>') % ( |
|
881 |
self.formdef.get_admin_url(), |
|
882 |
self.formdef_view_label, |
|
883 |
) |
|
877 | 884 |
return r.getvalue() |
878 | 885 | |
879 | 886 |
def get_formdata_sidebar(self, qs=''): |
880 |
- |