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):
invoice = invoice_line.getExplanationValue()
resource = invoice.getProperty('resource',
invoice.getProperty('price_currency', None))
portal = input_movement.getPortalObject()
if resource is None:
portal = input_movement.getPortalObject()
# search the resource on parents simulation movement's deliveries
simulation_movement = input_movement
portal_simulation = portal.portal_simulation
......
......@@ -32,7 +32,6 @@ import transaction
from DateTime import DateTime
from zLOG import LOG
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Testing import ZopeTestCase
from Products.ERP5.tests.testAccounting import AccountingTestCase
from AccessControl.SecurityManagement import newSecurityManager
......@@ -51,8 +50,8 @@ def printAndLog(msg):
ZopeTestCase._print('\n ' + msg)
LOG('Testing... ', 0, msg)
class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
class TestConversionInSimulation(AccountingTestCase):
username = 'username'
default_region = "europe/west/france"
vat_gap = 'fr/pcg/4/44/445/4457/44571'
......@@ -120,7 +119,8 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
**kw)
def afterSetUp(self):
ERP5TypeTestCase.login(self)
super(TestConversionInSimulation, self).afterSetUp()
super(TestConversionInSimulation, self).login()
self.createCategories()
self.createAndValidateAccounts()
self.login()
......@@ -140,7 +140,8 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
portal_type='Currency Exchange Line')])
transaction.commit()
self.tic()
super(TestConversionInSimulation, self).beforeTearDown()
def login(self,name=username, quiet=0, run=run_all_test):
uf = self.getPortal().acl_users
uf._doAddUser(self.username, '', ['Assignee', 'Assignor',
......@@ -788,6 +789,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
portal_type='Currency',
title='euro')
currency.setBaseUnitQuantity(0.01)
self.createBusinessProcess(currency)
transaction.commit()
self.tic()#execute transaction
client = self.portal.organisation_module.newContent(
......
......@@ -32,7 +32,6 @@ import transaction
from DateTime import DateTime
from zLOG import LOG
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Testing import ZopeTestCase
from Products.ERP5.tests.testAccounting import AccountingTestCase
from AccessControl.SecurityManagement import newSecurityManager
......@@ -51,8 +50,8 @@ def printAndLog(msg):
ZopeTestCase._print('\n ' + msg)
LOG('Testing... ', 0, msg)
class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
class TestConversionInSimulation(AccountingTestCase):
username = 'username'
default_region = "europe/west/france"
vat_gap = 'fr/pcg/4/44/445/4457/44571'
......@@ -128,6 +127,7 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
**kw)
def afterSetUp(self):
super(TestConversionInSimulation, self).afterSetUp()
self.createCategories()
self.validateRules()
self.login()
......@@ -147,7 +147,8 @@ class TestConversionInSimulation(AccountingTestCase,ERP5TypeTestCase):
portal_type='Currency Exchange Line')])
transaction.commit()
self.tic()
super(TestConversionInSimulation, self).beforeTearDown()
def login(self,name=username, quiet=0, run=run_all_test):
uf = self.getPortal().acl_users
uf._doAddUser(self.username, '', ['Assignee', 'Assignor',
......
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