Commit cd7b0179 authored by Romain Courteaud's avatar Romain Courteaud

slapos_wechat: test fix

parent b2125d76
...@@ -589,17 +589,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -589,17 +589,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
def test_PaymentTransaction_redirectToManualWechatPayment_redirect(self): def test_PaymentTransaction_redirectToManualWechatPayment_redirect(self):
self.portal.portal_secure_payments.slapos_wechat_test.setReference("PSERV-Wechat-Test") self.portal.portal_secure_payments.slapos_wechat_test.setReference("PSERV-Wechat-Test")
person = self.makePerson() project = self.addProject()
person = self.makePerson(project)
invoice = self.createStoppedSaleInvoiceTransaction( invoice = self.createStoppedSaleInvoiceTransaction(
payment_mode="wechat", payment_mode="wechat",
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='wechat', payment_mode='wechat',
causality_value=invoice, causality_value=invoice,
destination_section=invoice.getDestinationSection(), destination_section=invoice.getDestinationSection(),
destination_project_value=project,
resource_value=self.portal.currency_module.CNY, resource_value=self.portal.currency_module.CNY,
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')
...@@ -634,17 +639,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -634,17 +639,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
def test_PaymentTransaction_redirectToManualWechatPayment_redirect_with_website(self): def test_PaymentTransaction_redirectToManualWechatPayment_redirect_with_website(self):
self.portal.portal_secure_payments.slapos_wechat_test.setReference("PSERV-Wechat-Test") self.portal.portal_secure_payments.slapos_wechat_test.setReference("PSERV-Wechat-Test")
person = self.makePerson() project = self.addProject()
person = self.makePerson(project)
invoice = self.createStoppedSaleInvoiceTransaction( invoice = self.createStoppedSaleInvoiceTransaction(
payment_mode="wechat", payment_mode="wechat",
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='wechat', payment_mode='wechat',
causality_value=invoice, causality_value=invoice,
destination_section=invoice.getDestinationSection(), destination_section=invoice.getDestinationSection(),
destination_project_value=project,
resource_value=self.portal.currency_module.CNY, resource_value=self.portal.currency_module.CNY,
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')
...@@ -674,17 +684,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -674,17 +684,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
def test_PaymentTransaction_redirectToManualWechatPayment_already_registered(self): def test_PaymentTransaction_redirectToManualWechatPayment_already_registered(self):
person = self.makePerson() project = self.addProject()
person = self.makePerson(project)
invoice = self.createStoppedSaleInvoiceTransaction( invoice = self.createStoppedSaleInvoiceTransaction(
payment_mode="wechat", payment_mode="wechat",
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='wechat', payment_mode='wechat',
causality_value=invoice, causality_value=invoice,
destination_section=invoice.getDestinationSection(), destination_section=invoice.getDestinationSection(),
destination_project_value=project,
resource_value=self.portal.currency_module.CNY, resource_value=self.portal.currency_module.CNY,
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