Commit 5be88a84 authored by Jérome Perrin's avatar Jérome Perrin

check that we don't need write permission on the accounting transction to pass

confirm or stop transition (they call an after script which sets the
source/destination references)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21017 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent db2ab093
......@@ -1733,6 +1733,30 @@ class TestTransactions(AccountingTestCase):
self.assertEquals('code-2002-1', next_year_transaction.getSourceReference())
self.assertEquals('2002-1', next_year_transaction.getDestinationReference())
def test_SourceDestinationReferenceSecurity(self):
# Check that we don't need specific roles to set source reference and
# destination reference, as long as we can pass the workflow transition
# clear all existing ids in portal ids
if hasattr(self.portal.portal_ids, 'dict_ids'):
self.portal.portal_ids.dict_ids.clear()
section_period_2001 = self.section.newContent(
portal_type='Accounting Period',
short_title='code-2001',
start_date=DateTime(2001, 01, 01),
stop_date=DateTime(2001, 12, 31))
section_period_2001.start()
accounting_transaction = self._makeOne(
destination_section_value=self.organisation_module.client_1,
start_date=DateTime(2001, 01, 01),
stop_date=DateTime(2001, 01, 01))
accounting_transaction.manage_permission('Modify portal content',
roles=['Manager'], acquire=0)
accounting_transaction.stop()
self.assertEquals('code-2001-1', accounting_transaction.getSourceReference())
def test_SearchableText(self):
transaction = self._makeOne(title='A new Transaction',
description="A description",
......
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