Commit b94cb013 authored by Julien Muchembled's avatar Julien Muchembled

Fix some errors in test(Legacy)ConversionInSimulation

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@38210 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent abecfcaa
...@@ -110,8 +110,8 @@ class InvoiceTransactionRuleMovementGenerator(MovementGeneratorMixin): ...@@ -110,8 +110,8 @@ class InvoiceTransactionRuleMovementGenerator(MovementGeneratorMixin):
invoice = invoice_line.getExplanationValue() invoice = invoice_line.getExplanationValue()
resource = invoice.getProperty('resource', resource = invoice.getProperty('resource',
invoice.getProperty('price_currency', None)) invoice.getProperty('price_currency', None))
if resource is None:
portal = input_movement.getPortalObject() portal = input_movement.getPortalObject()
if resource is None:
# search the resource on parents simulation movement's deliveries # search the resource on parents simulation movement's deliveries
simulation_movement = input_movement simulation_movement = input_movement
portal_simulation = portal.portal_simulation portal_simulation = portal.portal_simulation
......
...@@ -32,7 +32,6 @@ import transaction ...@@ -32,7 +32,6 @@ import transaction
from DateTime import DateTime from DateTime import DateTime
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5.tests.testAccounting import AccountingTestCase from Products.ERP5.tests.testAccounting import AccountingTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -51,7 +50,7 @@ def printAndLog(msg): ...@@ -51,7 +50,7 @@ def printAndLog(msg):
ZopeTestCase._print('\n ' + msg) ZopeTestCase._print('\n ' + msg)
LOG('Testing... ', 0, msg) LOG('Testing... ', 0, msg)
class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase): class TestConversionInSimulation(AccountingTestCase):
username = 'username' username = 'username'
default_region = "europe/west/france" default_region = "europe/west/france"
...@@ -120,7 +119,8 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase): ...@@ -120,7 +119,8 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
**kw) **kw)
def afterSetUp(self): def afterSetUp(self):
ERP5TypeTestCase.login(self) super(TestConversionInSimulation, self).afterSetUp()
super(TestConversionInSimulation, self).login()
self.createCategories() self.createCategories()
self.createAndValidateAccounts() self.createAndValidateAccounts()
self.login() self.login()
...@@ -140,6 +140,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase): ...@@ -140,6 +140,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
portal_type='Currency Exchange Line')]) portal_type='Currency Exchange Line')])
transaction.commit() transaction.commit()
self.tic() self.tic()
super(TestConversionInSimulation, self).beforeTearDown()
def login(self,name=username, quiet=0, run=run_all_test): def login(self,name=username, quiet=0, run=run_all_test):
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
...@@ -788,6 +789,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase): ...@@ -788,6 +789,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
portal_type='Currency', portal_type='Currency',
title='euro') title='euro')
currency.setBaseUnitQuantity(0.01) currency.setBaseUnitQuantity(0.01)
self.createBusinessProcess(currency)
transaction.commit() transaction.commit()
self.tic()#execute transaction self.tic()#execute transaction
client = self.portal.organisation_module.newContent( client = self.portal.organisation_module.newContent(
......
...@@ -32,7 +32,6 @@ import transaction ...@@ -32,7 +32,6 @@ import transaction
from DateTime import DateTime from DateTime import DateTime
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5.tests.testAccounting import AccountingTestCase from Products.ERP5.tests.testAccounting import AccountingTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -51,7 +50,7 @@ def printAndLog(msg): ...@@ -51,7 +50,7 @@ def printAndLog(msg):
ZopeTestCase._print('\n ' + msg) ZopeTestCase._print('\n ' + msg)
LOG('Testing... ', 0, msg) LOG('Testing... ', 0, msg)
class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase): class TestConversionInSimulation(AccountingTestCase):
username = 'username' username = 'username'
default_region = "europe/west/france" default_region = "europe/west/france"
...@@ -128,6 +127,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase): ...@@ -128,6 +127,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
**kw) **kw)
def afterSetUp(self): def afterSetUp(self):
super(TestConversionInSimulation, self).afterSetUp()
self.createCategories() self.createCategories()
self.validateRules() self.validateRules()
self.login() self.login()
...@@ -147,6 +147,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase): ...@@ -147,6 +147,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
portal_type='Currency Exchange Line')]) portal_type='Currency Exchange Line')])
transaction.commit() transaction.commit()
self.tic() self.tic()
super(TestConversionInSimulation, self).beforeTearDown()
def login(self,name=username, quiet=0, run=run_all_test): def login(self,name=username, quiet=0, run=run_all_test):
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
......
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