Commit a416ff8f authored by Aurel's avatar Aurel

add generation and chek of source reference for unit test that need it


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10073 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5a3185a9
...@@ -253,6 +253,11 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -253,6 +253,11 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin, ERP5TypeTestCase):
self.quantity_10000) self.quantity_10000)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.cash_exchange)
# check source reference
self.assertNotEqual(self.cash_exchange.getSourceReference(), '')
self.assertNotEqual(self.cash_exchange.getSourceReference(), None)
# check there is only one line created # check there is only one line created
self.assertEqual(len(self.cash_exchange.objectValues()), 1) self.assertEqual(len(self.cash_exchange.objectValues()), 1)
# get the cash exchange line # get the cash exchange line
......
...@@ -181,6 +181,11 @@ class TestERP5BankingCashIncident(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -181,6 +181,11 @@ class TestERP5BankingCashIncident(TestERP5BankingMixin, ERP5TypeTestCase):
self.cash_incident = self.cash_incident_module.newContent(id='cash_incident_1', portal_type='Cash Incident', source_total_asset_price=52400.0,) self.cash_incident = self.cash_incident_module.newContent(id='cash_incident_1', portal_type='Cash Incident', source_total_asset_price=52400.0,)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.account_incident)
# check source reference
self.assertNotEqual(self.cash_incident.getSourceReference(), '')
self.assertNotEqual(self.cash_incident.getSourceReference(), None)
# set source here # set source here
self.cash_incident._setSource(self.counter.getRelativeUrl()) self.cash_incident._setSource(self.counter.getRelativeUrl())
# check we have only one cash transfer # check we have only one cash transfer
......
...@@ -223,6 +223,11 @@ class TestERP5BankingCashSorting(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -223,6 +223,11 @@ class TestERP5BankingCashSorting(TestERP5BankingMixin, ERP5TypeTestCase):
self.cash_sorting = self.cash_sorting_module.newContent(id='cash_sorting_1', portal_type='Cash Sorting', source_value=self.encaisse_tri, destination_value=None, source_total_asset_price=52400.0) self.cash_sorting = self.cash_sorting_module.newContent(id='cash_sorting_1', portal_type='Cash Sorting', source_value=self.encaisse_tri, destination_value=None, source_total_asset_price=52400.0)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.cash_sorting)
# check source reference
self.assertNotEqual(self.cash_sorting.getSourceReference(), '')
self.assertNotEqual(self.cash_sorting.getSourceReference(), None)
# check we have only one cash sorting # check we have only one cash sorting
self.assertEqual(len(self.cash_sorting_module.objectValues()), 1) self.assertEqual(len(self.cash_sorting_module.objectValues()), 1)
# get the cash sorting document # get the cash sorting document
......
...@@ -191,11 +191,11 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -191,11 +191,11 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.check_deposit.getSourceTotalAssetPrice(), 500.0) self.assertEqual(self.check_deposit.getSourceTotalAssetPrice(), 500.0)
# the initial state must be draft # the initial state must be draft
self.assertEqual(self.check_deposit.getSimulationState(), 'draft') self.assertEqual(self.check_deposit.getSimulationState(), 'draft')
# set source reference
# source reference must be automatically generated self.setDocumentSourceReference(self.check_deposit)
# self.check_deposit.setSourceReference(self.check_deposit.Baobab_getUniqueReference()) # check source reference
# self.assertNotEqual(self.check_deposit.getSourceReference(), None) self.assertNotEqual(self.check_deposit.getSourceReference(), '')
# self.assertNotEqual(self.check_deposit.getSourceReference(), '') self.assertNotEqual(self.check_deposit.getSourceReference(), None)
def stepAddCheckOperationLine(self, sequence=None, sequence_list=None, **kwd): def stepAddCheckOperationLine(self, sequence=None, sequence_list=None, **kwd):
""" """
......
...@@ -220,7 +220,11 @@ class TestERP5BankingCheckPayment(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -220,7 +220,11 @@ class TestERP5BankingCheckPayment(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.check_payment.getAggregateFreeText(), self.check_1.getReference()) self.assertEqual(self.check_payment.getAggregateFreeText(), self.check_1.getReference())
self.assertEqual(self.check_payment.getSourceTotalAssetPrice(), 20000.0) self.assertEqual(self.check_payment.getSourceTotalAssetPrice(), 20000.0)
self.assertEqual(self.check_payment.getSource(), self.bi_counter.getRelativeUrl()) self.assertEqual(self.check_payment.getSource(), self.bi_counter.getRelativeUrl())
# set source reference
self.setDocumentSourceReference(self.check_payment)
# check source reference
self.assertNotEqual(self.check_payment.getSourceReference(), '')
self.assertNotEqual(self.check_payment.getSourceReference(), None)
# the initial state must be draft # the initial state must be draft
self.assertEqual(self.check_payment.getSimulationState(), 'draft') self.assertEqual(self.check_payment.getSimulationState(), 'draft')
......
...@@ -200,6 +200,11 @@ class TestERP5BankingClassificationSurvey(TestERP5BankingMixin, ERP5TypeTestCase ...@@ -200,6 +200,11 @@ class TestERP5BankingClassificationSurvey(TestERP5BankingMixin, ERP5TypeTestCase
self.classification_survey = self.classification_survey_module.newContent(id='classification_survey_1', portal_type='Classification Survey', source_value=self.encaisse_a_detruire, destination_value=None, source_total_asset_price=52400.0) self.classification_survey = self.classification_survey_module.newContent(id='classification_survey_1', portal_type='Classification Survey', source_value=self.encaisse_a_detruire, destination_value=None, source_total_asset_price=52400.0)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.classification_survey)
# check source reference
self.assertNotEqual(self.classification_survey.getSourceReference(), '')
self.assertNotEqual(self.classification_survey.getSourceReference(), None)
# check we have only one classification surveyg # check we have only one classification surveyg
self.assertEqual(len(self.classification_survey_module.objectValues()), 1) self.assertEqual(len(self.classification_survey_module.objectValues()), 1)
# get the classification surveyg document # get the classification surveyg document
......
...@@ -200,6 +200,11 @@ class TestERP5BankingInternalMoneyDeposit(TestERP5BankingMixin, ERP5TypeTestCase ...@@ -200,6 +200,11 @@ class TestERP5BankingInternalMoneyDeposit(TestERP5BankingMixin, ERP5TypeTestCase
source_total_asset_price=20000.0) source_total_asset_price=20000.0)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.internal_money_deposit)
# check source reference
self.assertNotEqual(self.internal_money_deposit.getSourceReference(), '')
self.assertNotEqual(self.internal_money_deposit.getSourceReference(), None)
# check we have only one cash sorting # check we have only one cash sorting
self.assertEqual(len(self.internal_money_deposit_module.objectValues()), 1) self.assertEqual(len(self.internal_money_deposit_module.objectValues()), 1)
# get the cash sorting document # get the cash sorting document
......
...@@ -267,6 +267,11 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin, ERP5TypeTestCase) ...@@ -267,6 +267,11 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin, ERP5TypeTestCase)
source_total_asset_price=110000.0, source_section_value=self.paris) source_total_asset_price=110000.0, source_section_value=self.paris)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.monetary_destruction)
# check source reference
self.assertNotEqual(self.monetary_destruction.getSourceReference(), '')
self.assertNotEqual(self.monetary_destruction.getSourceReference(), None)
# check we have only one monetary destruction # check we have only one monetary destruction
self.assertEqual(len(self.monetary_destruction_module.objectValues()), 1) self.assertEqual(len(self.monetary_destruction_module.objectValues()), 1)
# get the monetary destruction document # get the monetary destruction document
......
...@@ -209,6 +209,11 @@ class TestERP5BankingMonetaryIssue(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -209,6 +209,11 @@ class TestERP5BankingMonetaryIssue(TestERP5BankingMixin, ERP5TypeTestCase):
self.monetary_issue = self.monetary_issue_module.newContent(id='monetary_issue', portal_type='Monetary Issue', start_date=self.current_date) self.monetary_issue = self.monetary_issue_module.newContent(id='monetary_issue', portal_type='Monetary Issue', start_date=self.current_date)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.monetary_issue)
# check source reference
self.assertNotEqual(self.monetary_issue.getSourceReference(), '')
self.assertNotEqual(self.monetary_issue.getSourceReference(), None)
# get the cash inventory document # get the cash inventory document
self.monetary_issue = getattr(self.monetary_issue_module, 'monetary_issue') self.monetary_issue = getattr(self.monetary_issue_module, 'monetary_issue')
# check its portal type # check its portal type
......
...@@ -225,6 +225,11 @@ class TestERP5BankingMonetaryRecall(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -225,6 +225,11 @@ class TestERP5BankingMonetaryRecall(TestERP5BankingMixin, ERP5TypeTestCase):
self.assertEqual(self.monetary_recall.getPortalType(), 'Monetary Recall') self.assertEqual(self.monetary_recall.getPortalType(), 'Monetary Recall')
# check that its source is cash # check that its source is cash
self.assertEqual(self.monetary_recall.getSource(), 'site/testsite/paris/caveau/auxiliaire/encaisse_des_billets_et_monnaies') self.assertEqual(self.monetary_recall.getSource(), 'site/testsite/paris/caveau/auxiliaire/encaisse_des_billets_et_monnaies')
# set source reference
self.setDocumentSourceReference(self.monetary_recall)
# check source reference
self.assertNotEqual(self.monetary_recallaccount_incident.getSourceReference(), '')
self.assertNotEqual(self.monetary_recall.getSourceReference(), None)
# check that its destination is counter # check that its destination is counter
##self.assertEqual(self.monetary_recall.getDestination(), ##self.assertEqual(self.monetary_recall.getDestination(),
##'site/testsite/paris/caveau/serre/encaisse_des_billets_retires_de_la_circulation') ##'site/testsite/paris/caveau/serre/encaisse_des_billets_retires_de_la_circulation')
......
...@@ -196,6 +196,11 @@ class TestERP5BankingMonetarySurvey(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -196,6 +196,11 @@ class TestERP5BankingMonetarySurvey(TestERP5BankingMixin, ERP5TypeTestCase):
self.monetary_survey = self.monetary_survey_module.newContent(id='monetary_survey_1', portal_type='Monetary Survey', source_value=self.source, destination_value=self.destination, source_total_asset_price=52400.0) self.monetary_survey = self.monetary_survey_module.newContent(id='monetary_survey_1', portal_type='Monetary Survey', source_value=self.source, destination_value=self.destination, source_total_asset_price=52400.0)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.monetary_survey)
# check source reference
self.assertNotEqual(self.monetary_survey.getSourceReference(), '')
self.assertNotEqual(self.monetary_survey.getSourceReference(), None)
# check we have only one cash transfer # check we have only one cash transfer
self.assertEqual(len(self.monetary_survey_module.objectValues()), 1) self.assertEqual(len(self.monetary_survey_module.objectValues()), 1)
# get the cash transfer document # get the cash transfer document
......
...@@ -213,6 +213,11 @@ class TestERP5BankingMoneyDeposit(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -213,6 +213,11 @@ class TestERP5BankingMoneyDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
source_total_asset_price=20000.0) source_total_asset_price=20000.0)
# execute tic # execute tic
self.stepTic() self.stepTic()
# set source reference
self.setDocumentSourceReference(self.money_deposit)
# check source reference
self.assertNotEqual(self.money_deposit.getSourceReference(), '')
self.assertNotEqual(self.money_deposit.getSourceReference(), None)
self.money_deposit._setDestination(self.bi_counter.getRelativeUrl()) self.money_deposit._setDestination(self.bi_counter.getRelativeUrl())
self.assertNotEqual(self.money_deposit, None) self.assertNotEqual(self.money_deposit, None)
......
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