Commit 68b0db4c authored by Romain Courteaud's avatar Romain Courteaud

Payment without simulation has a draft causality state

parent 37198d9a
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
portal.portal_catalog.searchAndActivate(\n portal.portal_catalog.searchAndActivate(\n
portal_type="Payment Transaction", \n portal_type="Payment Transaction", \n
simulation_state=["confirmed"],\n simulation_state=["confirmed"],\n
causality_state=["solved"],\n causality_state=["draft"],\n
payment_mode_uid=portal.portal_categories.payment_mode.payzen.getUid(),\n payment_mode_uid=portal.portal_categories.payment_mode.payzen.getUid(),\n
method_id=\'PaymentTransaction_startPayzenPayment\',\n method_id=\'PaymentTransaction_startPayzenPayment\',\n
packet_size=1, # just one to minimise errors\n packet_size=1, # just one to minimise errors\n
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
portal.portal_catalog.searchAndActivate(\n portal.portal_catalog.searchAndActivate(\n
portal_type="Payment Transaction", \n portal_type="Payment Transaction", \n
simulation_state=["started"],\n simulation_state=["started"],\n
causality_state=["solved"],\n causality_state=["draft"],\n
payment_mode_uid=portal.portal_categories.payment_mode.payzen.getUid(),\n payment_mode_uid=portal.portal_categories.payment_mode.payzen.getUid(),\n
method_id=\'PaymentTransaction_updateStatus\',\n method_id=\'PaymentTransaction_updateStatus\',\n
packet_size=1, # just one to minimise errors\n packet_size=1, # just one to minimise errors\n
......
...@@ -30,7 +30,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -30,7 +30,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
self.portal.portal_skins.custom.manage_delObjects(script_name) self.portal.portal_skins.custom.manage_delObjects(script_name)
transaction.commit() transaction.commit()
def test_alarm_confirmed_solved_payzen(self): def test_alarm_confirmed_draft_payzen(self):
new_id = self.generateNewId() new_id = self.generateNewId()
transaction = self.portal.accounting_module.newContent( transaction = self.portal.accounting_module.newContent(
portal_type='Payment Transaction', portal_type='Payment Transaction',
...@@ -39,7 +39,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -39,7 +39,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
payment_mode="payzen", payment_mode="payzen",
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'confirmed') self.portal.portal_workflow._jumpToStateFor(transaction, 'confirmed')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self.tic() self.tic()
self._simulatePaymentTransaction_startPayzenPayment() self._simulatePaymentTransaction_startPayzenPayment()
...@@ -61,7 +60,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -61,7 +60,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
reference="TESTTRANS-%s" % new_id, reference="TESTTRANS-%s" % new_id,
payment_mode="payzen", payment_mode="payzen",
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self.tic() self.tic()
self._simulatePaymentTransaction_startPayzenPayment() self._simulatePaymentTransaction_startPayzenPayment()
...@@ -75,7 +73,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -75,7 +73,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
'Visited by PaymentTransaction_startPayzenPayment', 'Visited by PaymentTransaction_startPayzenPayment',
transaction.workflow_history['edit_workflow'][-1]['comment']) transaction.workflow_history['edit_workflow'][-1]['comment'])
def test_alarm_not_solved(self): def test_alarm_not_draft(self):
new_id = self.generateNewId() new_id = self.generateNewId()
transaction = self.portal.accounting_module.newContent( transaction = self.portal.accounting_module.newContent(
portal_type='Payment Transaction', portal_type='Payment Transaction',
...@@ -84,6 +82,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -84,6 +82,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
payment_mode="payzen", payment_mode="payzen",
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'confirmed') self.portal.portal_workflow._jumpToStateFor(transaction, 'confirmed')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self.tic() self.tic()
self._simulatePaymentTransaction_startPayzenPayment() self._simulatePaymentTransaction_startPayzenPayment()
...@@ -105,7 +104,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -105,7 +104,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
reference="TESTTRANS-%s" % new_id, reference="TESTTRANS-%s" % new_id,
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'confirmed') self.portal.portal_workflow._jumpToStateFor(transaction, 'confirmed')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self.tic() self.tic()
self._simulatePaymentTransaction_startPayzenPayment() self._simulatePaymentTransaction_startPayzenPayment()
...@@ -174,7 +172,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -174,7 +172,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
payment_mode="payzen", payment_mode="payzen",
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'confirmed') self.portal.portal_workflow._jumpToStateFor(transaction, 'confirmed')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self._simulatePaymentTransaction_sendManualPayzenPaymentUrl() self._simulatePaymentTransaction_sendManualPayzenPaymentUrl()
try: try:
...@@ -247,7 +244,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -247,7 +244,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
payment_mode="payzen", payment_mode="payzen",
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'started') self.portal.portal_workflow._jumpToStateFor(transaction, 'started')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self._simulatePaymentTransaction_addPayzenTicket() self._simulatePaymentTransaction_addPayzenTicket()
try: try:
...@@ -311,7 +307,6 @@ return Foo() ...@@ -311,7 +307,6 @@ return Foo()
start_date=DateTime(), start_date=DateTime(),
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'started') self.portal.portal_workflow._jumpToStateFor(transaction, 'started')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
# Manually generate mapping # Manually generate mapping
transaction.PaymentTransaction_generatePayzenId() transaction.PaymentTransaction_generatePayzenId()
...@@ -341,7 +336,6 @@ return Foo() ...@@ -341,7 +336,6 @@ return Foo()
start_date=DateTime(), start_date=DateTime(),
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'started') self.portal.portal_workflow._jumpToStateFor(transaction, 'started')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
# Manually generate mapping # Manually generate mapping
transaction.PaymentTransaction_generatePayzenId() transaction.PaymentTransaction_generatePayzenId()
...@@ -379,7 +373,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -379,7 +373,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
self.portal.portal_skins.custom.manage_delObjects(script_name) self.portal.portal_skins.custom.manage_delObjects(script_name)
transaction.commit() transaction.commit()
def test_alarm_started_solved_payzen(self): def test_alarm_started_draft_payzen(self):
new_id = self.generateNewId() new_id = self.generateNewId()
transaction = self.portal.accounting_module.newContent( transaction = self.portal.accounting_module.newContent(
portal_type='Payment Transaction', portal_type='Payment Transaction',
...@@ -388,7 +382,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -388,7 +382,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
payment_mode="payzen", payment_mode="payzen",
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'started') self.portal.portal_workflow._jumpToStateFor(transaction, 'started')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self.tic() self.tic()
self._simulatePaymentTransaction_updateStatus() self._simulatePaymentTransaction_updateStatus()
...@@ -410,7 +403,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -410,7 +403,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
reference="TESTTRANS-%s" % new_id, reference="TESTTRANS-%s" % new_id,
payment_mode="payzen", payment_mode="payzen",
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self.tic() self.tic()
self._simulatePaymentTransaction_updateStatus() self._simulatePaymentTransaction_updateStatus()
...@@ -424,7 +416,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -424,7 +416,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
'Visited by PaymentTransaction_updateStatus', 'Visited by PaymentTransaction_updateStatus',
transaction.workflow_history['edit_workflow'][-1]['comment']) transaction.workflow_history['edit_workflow'][-1]['comment'])
def test_alarm_not_solved(self): def test_alarm_not_draft(self):
new_id = self.generateNewId() new_id = self.generateNewId()
transaction = self.portal.accounting_module.newContent( transaction = self.portal.accounting_module.newContent(
portal_type='Payment Transaction', portal_type='Payment Transaction',
...@@ -433,6 +425,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -433,6 +425,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
payment_mode="payzen", payment_mode="payzen",
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'started') self.portal.portal_workflow._jumpToStateFor(transaction, 'started')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self.tic() self.tic()
self._simulatePaymentTransaction_updateStatus() self._simulatePaymentTransaction_updateStatus()
...@@ -454,7 +447,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P ...@@ -454,7 +447,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
reference="TESTTRANS-%s" % new_id, reference="TESTTRANS-%s" % new_id,
) )
self.portal.portal_workflow._jumpToStateFor(transaction, 'started') self.portal.portal_workflow._jumpToStateFor(transaction, 'started')
self.portal.portal_workflow._jumpToStateFor(transaction, 'solved')
self.tic() self.tic()
self._simulatePaymentTransaction_updateStatus() self._simulatePaymentTransaction_updateStatus()
......
89 90
\ No newline at end of file \ No newline at end of file
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