Commit 6bd5f418 authored by Romain Courteaud's avatar Romain Courteaud

slapos_wechat: test fix

parent f15b1718
......@@ -577,17 +577,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self._dropPaymentTransaction_getVADSUrlDict()
def test_PaymentTransaction_redirectToManualWechatPayment_redirect(self):
person = self.makePerson()
project = self.addProject()
person = self.makePerson(project)
invoice = self.createStoppedSaleInvoiceTransaction(
payment_mode="wechat",
destination_section=person.getRelativeUrl())
destination_section_value=person,
destination_project_value=project
)
self.tic()
payment = self.portal.accounting_module.newContent(
portal_type="Payment Transaction",
payment_mode='wechat',
causality_value=invoice,
destination_section=invoice.getDestinationSection(),
destination_project_value=project,
resource_value=self.portal.currency_module.CNY,
ledger="automated",
created_by_builder=1 # to prevent init script to create lines
)
self.portal.portal_workflow._jumpToStateFor(payment, 'started')
......@@ -621,17 +626,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
transaction.abort()
def test_PaymentTransaction_redirectToManualWechatPayment_redirect_with_website(self):
person = self.makePerson()
project = self.addProject()
person = self.makePerson(project)
invoice = self.createStoppedSaleInvoiceTransaction(
payment_mode="wechat",
destination_section=person.getRelativeUrl())
destination_section_value=person,
destination_project_value=project
)
self.tic()
payment = self.portal.accounting_module.newContent(
portal_type="Payment Transaction",
payment_mode='wechat',
causality_value=invoice,
destination_section=invoice.getDestinationSection(),
destination_project_value=project,
resource_value=self.portal.currency_module.CNY,
ledger="automated",
created_by_builder=1 # to prevent init script to create lines
)
self.portal.portal_workflow._jumpToStateFor(payment, 'started')
......@@ -661,17 +671,22 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
def test_PaymentTransaction_redirectToManualWechatPayment_already_registered(self):
person = self.makePerson()
project = self.addProject()
person = self.makePerson(project)
invoice = self.createStoppedSaleInvoiceTransaction(
payment_mode="wechat",
destination_section=person.getRelativeUrl())
destination_section_value=person,
destination_project_value=project
)
self.tic()
payment = self.portal.accounting_module.newContent(
portal_type="Payment Transaction",
payment_mode='wechat',
causality_value=invoice,
destination_section=invoice.getDestinationSection(),
destination_project_value=project,
resource_value=self.portal.currency_module.CNY,
ledger="automated",
created_by_builder=1 # to prevent init script to create lines
)
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