Commit fc3da930 authored by Vincent Pelletier's avatar Vincent Pelletier

testTradeReports: Allow reusing in site-dependent security group setups.

This test alone does not define site-dependent security groups, so this
change is not required as such.
But in real configuration, ERP5 instance define security groups, which
sometimes (often ?) depend on which site a document or user is linked to.
When multiple groups apply (ex: having a certain function at a certain
site), the final group is composed by joining group identifiers using
underscores. This forbids using underscores in group identifiers.
And group identifiers are generated from document's (here, the Category)
codification if set, otherwise the reference if set, otherwise the document
identifier.
So set a underscore-less codification on these categories so this test can
be run on tests where security is configured to include site in security
groups.
parent 405ee70e
......@@ -72,12 +72,16 @@ class TestTradeReports(ERP5ReportTestCase):
self.portal_categories = self.portal.portal_categories
# Create site category
for site_id in ('demo_site_A', 'demo_site_B',):
for site_id, codification in (
('demo_site_A', 'DEMO-SITE-A'),
('demo_site_B', 'DEMO-SITE-B'),
):
if not self.portal_categories['site'].has_key(site_id):
self.portal_categories.site.newContent(
portal_type='Category',
title=site_id,
reference=site_id,
codification=codification,
id=site_id)
# Colour categories
for colour_id in ('colour1', 'colour2',):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment