diff --git a/tests/admin_pages/test_card.py b/tests/admin_pages/test_card.py index ea3ef2749..19edd31d0 100644 --- a/tests/admin_pages/test_card.py +++ b/tests/admin_pages/test_card.py @@ -404,16 +404,6 @@ def test_card_id_template(pub): carddata.store() app = login(get_app(pub)) - resp = app.get('/backoffice/cards/1/') - resp = resp.click('Templates') - assert 'id_template' not in resp.text - - if not pub.site_options.has_section('options'): - pub.site_options.add_section('options') - pub.site_options.set('options', 'enable-card-identifier-template', 'true') - with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd: - pub.site_options.write(fd) - resp = app.get('/backoffice/cards/1/') resp = resp.click('Templates') assert 'Identifier cannot be modified if there are existing cards.' in resp.text @@ -437,6 +427,16 @@ def test_card_id_template(pub): carddata.store() assert carddata.id_display == 'XbarY' + # check option is not advertised if disabled + if not pub.site_options.has_section('options'): + pub.site_options.add_section('options') + pub.site_options.set('options', 'enable-card-identifier-template', 'false') + with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd: + pub.site_options.write(fd) + resp = app.get('/backoffice/cards/1/') + resp = resp.click('Templates') + assert 'id_template' not in resp.text + def test_card_digest_template(pub): create_superuser(pub) diff --git a/wcs/qommon/publisher.py b/wcs/qommon/publisher.py index b97931099..a1749da9e 100644 --- a/wcs/qommon/publisher.py +++ b/wcs/qommon/publisher.py @@ -442,6 +442,7 @@ class QommonPublisher(Publisher): 'allow-tracking-code-in-url': 'true', 'disabled-fields': 'ranked-items, table, table-select, tablerows', 'disable-rtf-support': 'true', + 'enable-card-identifier-template': 'true', 'enable-intermediate-anonymisation': 'true', 'relatable-hosts': '', 'sync-map-and-address-fields': 'true',