Commit 22660480 authored by Romain Courteaud's avatar Romain Courteaud

slapos_payzen: test fix

parent 8ea91f7c
...@@ -25,6 +25,7 @@ from DateTime import DateTime ...@@ -25,6 +25,7 @@ from DateTime import DateTime
from zExceptions import Unauthorized from zExceptions import Unauthorized
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
class TestSlapOSCurrency_getIntegrationMapping(SlapOSTestCaseMixinWithAbort): class TestSlapOSCurrency_getIntegrationMapping(SlapOSTestCaseMixinWithAbort):
def test_integratedCurrency(self): def test_integratedCurrency(self):
...@@ -727,16 +728,21 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -727,16 +728,21 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
def test_PaymentTransaction_redirectToManualPayzenPayment_redirect(self): def test_PaymentTransaction_redirectToManualPayzenPayment_redirect(self):
self.portal.portal_secure_payments.slapos_payzen_test.setReference("PSERV-Payzen-Test") self.portal.portal_secure_payments.slapos_payzen_test.setReference("PSERV-Payzen-Test")
self.tic() self.tic()
person = self.makePerson() project = self.addProject()
person = self.makePerson(project)
invoice = self.createStoppedSaleInvoiceTransaction( invoice = self.createStoppedSaleInvoiceTransaction(
destination_section=person.getRelativeUrl()) destination_section_value=person,
destination_project_value=project
)
self.tic() self.tic()
payment = self.portal.accounting_module.newContent( payment = self.portal.accounting_module.newContent(
portal_type="Payment Transaction", portal_type="Payment Transaction",
payment_mode='payzen', payment_mode='payzen',
causality_value=invoice, causality_value=invoice,
destination_section=invoice.getDestinationSection(), destination_section_value=invoice.getDestinationSectionValue(),
destination_project_value=invoice.getDestinationProjectValue(),
resource_value=self.portal.currency_module.EUR, resource_value=self.portal.currency_module.EUR,
ledger="automated",
created_by_builder=1 # to prevent init script to create lines created_by_builder=1 # to prevent init script to create lines
) )
self.portal.portal_workflow._jumpToStateFor(payment, 'started') self.portal.portal_workflow._jumpToStateFor(payment, 'started')
...@@ -778,16 +784,21 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -778,16 +784,21 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
len(system_event_list[0].contentValues(portal_type="Payzen Event Message")), 1) len(system_event_list[0].contentValues(portal_type="Payzen Event Message")), 1)
def test_PaymentTransaction_redirectToManualPayzenPayment_already_registered(self): def test_PaymentTransaction_redirectToManualPayzenPayment_already_registered(self):
person = self.makePerson() project = self.addProject()
person = self.makePerson(project)
invoice = self.createStoppedSaleInvoiceTransaction( invoice = self.createStoppedSaleInvoiceTransaction(
destination_section=person.getRelativeUrl()) destination_section_value=person,
destination_project_value=project
)
self.tic() self.tic()
payment = self.portal.accounting_module.newContent( payment = self.portal.accounting_module.newContent(
portal_type="Payment Transaction", portal_type="Payment Transaction",
payment_mode='payzen', payment_mode='payzen',
causality_value=invoice, causality_value=invoice,
destination_section=invoice.getDestinationSection(), destination_section_value=invoice.getDestinationSectionValue(),
destination_project_value=invoice.getDestinationProjectValue(),
resource_value=self.portal.currency_module.EUR, resource_value=self.portal.currency_module.EUR,
ledger="automated",
created_by_builder=1 # to prevent init script to create lines created_by_builder=1 # to prevent init script to create lines
) )
self.portal.portal_workflow._jumpToStateFor(payment, 'started') self.portal.portal_workflow._jumpToStateFor(payment, 'started')
......
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