Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ophélie Gagnard
slapos.core
Commits
b5dc01cc
Commit
b5dc01cc
authored
Jan 18, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_payzen: Clean up test (make lint happy).
parent
2270e851
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
120 deletions
+80
-120
master/bt5/slapos_payzen/TestTemplateItem/portal_components/test.erp5.testSlapOSPayzenSkins.py
...Item/portal_components/test.erp5.testSlapOSPayzenSkins.py
+49
-80
master/bt5/slapos_payzen/TestTemplateItem/portal_components/test.erp5.testSlapOSPayzenSkins.xml
...tem/portal_components/test.erp5.testSlapOSPayzenSkins.xml
+31
-40
No files found.
master/bt5/slapos_payzen/TestTemplateItem/portal_components/test.erp5.testSlapOSPayzenSkins.py
View file @
b5dc01cc
# Copyright (c) 2002-2012 Nexedi SA and Contributors. All Rights Reserved.
# Copyright (c) 2002-2012 Nexedi SA and Contributors. All Rights Reserved.
import
transaction
from
Products.SlapOS.tests.testSlapOSMixin
import
\
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
testSlapOSMixin
from
DateTime
import
DateTime
from
DateTime
import
DateTime
...
@@ -8,8 +7,7 @@ from Products.ERP5Type.tests.utils import createZODBPythonScript
...
@@ -8,8 +7,7 @@ from Products.ERP5Type.tests.utils import createZODBPythonScript
class
TestSlapOSCurrency_getIntegrationMapping
(
testSlapOSMixin
):
class
TestSlapOSCurrency_getIntegrationMapping
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
abort_transaction
=
1
transaction
.
abort
()
def
test_integratedCurrency
(
self
):
def
test_integratedCurrency
(
self
):
currency
=
self
.
portal
.
currency_module
.
EUR
currency
=
self
.
portal
.
currency_module
.
EUR
...
@@ -29,8 +27,7 @@ class TestSlapOSCurrency_getIntegrationMapping(testSlapOSMixin):
...
@@ -29,8 +27,7 @@ class TestSlapOSCurrency_getIntegrationMapping(testSlapOSMixin):
class
TestSlapOSAccountingTransaction_updateStartDate
(
testSlapOSMixin
):
class
TestSlapOSAccountingTransaction_updateStartDate
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
abort_transaction
=
1
transaction
.
abort
()
def
createPaymentTransaction
(
self
):
def
createPaymentTransaction
(
self
):
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
...
@@ -42,23 +39,22 @@ class TestSlapOSAccountingTransaction_updateStartDate(testSlapOSMixin):
...
@@ -42,23 +39,22 @@ class TestSlapOSAccountingTransaction_updateStartDate(testSlapOSMixin):
def
test_date_changed
(
self
):
def
test_date_changed
(
self
):
date
=
DateTime
(
"2001/01/01"
)
date
=
DateTime
(
"2001/01/01"
)
transaction
=
self
.
createPaymentTransaction
()
payment_
transaction
=
self
.
createPaymentTransaction
()
transaction
.
AccountingTransaction_updateStartDate
(
date
)
payment_
transaction
.
AccountingTransaction_updateStartDate
(
date
)
self
.
assertEquals
(
transaction
.
getStartDate
(),
date
)
self
.
assertEquals
(
payment_
transaction
.
getStartDate
(),
date
)
def
test_REQUEST_disallowed
(
self
):
def
test_REQUEST_disallowed
(
self
):
date
=
DateTime
()
date
=
DateTime
()
transaction
=
self
.
createPaymentTransaction
()
payment_
transaction
=
self
.
createPaymentTransaction
()
self
.
assertRaises
(
self
.
assertRaises
(
Unauthorized
,
Unauthorized
,
transaction
.
AccountingTransaction_updateStartDate
,
payment_
transaction
.
AccountingTransaction_updateStartDate
,
date
,
REQUEST
=
{})
date
,
REQUEST
=
{})
class
TestSlapOSPaymentTransaction_getPayzenId
(
testSlapOSMixin
):
class
TestSlapOSPaymentTransaction_getPayzenId
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
abort_transaction
=
1
transaction
.
abort
()
def
createPaymentTransaction
(
self
):
def
createPaymentTransaction
(
self
):
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
...
@@ -69,48 +65,46 @@ class TestSlapOSPaymentTransaction_getPayzenId(testSlapOSMixin):
...
@@ -69,48 +65,46 @@ class TestSlapOSPaymentTransaction_getPayzenId(testSlapOSMixin):
)
)
def
test_getPayzenId_newPaymentTransaction
(
self
):
def
test_getPayzenId_newPaymentTransaction
(
self
):
transaction
=
self
.
createPaymentTransaction
()
payment_
transaction
=
self
.
createPaymentTransaction
()
self
.
assertEquals
(
transaction
.
PaymentTransaction_getPayzenId
(),
(
None
,
None
))
self
.
assertEquals
(
payment_
transaction
.
PaymentTransaction_getPayzenId
(),
(
None
,
None
))
def
test_getPayzenId_mappedPaymentTransaction
(
self
):
def
test_getPayzenId_mappedPaymentTransaction
(
self
):
transaction
=
self
.
createPaymentTransaction
()
payment_
transaction
=
self
.
createPaymentTransaction
()
transaction_date
,
payzen_id
=
transaction
.
PaymentTransaction_generatePayzenId
()
transaction_date
,
payzen_id
=
payment_
transaction
.
PaymentTransaction_generatePayzenId
()
transaction_date2
,
payzen_id2
=
transaction
.
PaymentTransaction_getPayzenId
()
transaction_date2
,
payzen_id2
=
payment_
transaction
.
PaymentTransaction_getPayzenId
()
self
.
assertEquals
(
payzen_id
,
payzen_id2
)
self
.
assertEquals
(
payzen_id
,
payzen_id2
)
self
.
assertEquals
(
transaction_date
,
transaction_date2
)
self
.
assertEquals
(
transaction_date
,
transaction_date2
)
def
test_getPayzenId_manualMappedPaymentTransaction
(
self
):
def
test_getPayzenId_manualMappedPaymentTransaction
(
self
):
transaction
=
self
.
createPaymentTransaction
()
payment_
transaction
=
self
.
createPaymentTransaction
()
integration_site
=
self
.
portal
.
restrictedTraverse
(
integration_site
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredPayzenIntegrationSite
())
self
.
portal
.
portal_preferences
.
getPreferredPayzenIntegrationSite
())
try
:
try
:
mapping
=
integration_site
.
getCategoryFromMapping
(
integration_site
.
getCategoryFromMapping
(
'Causality/%s'
%
transaction
.
getId
().
replace
(
'-'
,
'_'
),
'Causality/%s'
%
payment_
transaction
.
getId
().
replace
(
'-'
,
'_'
),
create_mapping_line
=
True
,
create_mapping_line
=
True
,
create_mapping
=
True
)
create_mapping
=
True
)
except
ValueError
:
except
ValueError
:
pass
pass
integration_site
.
Causality
[
transaction
.
getId
().
replace
(
'-'
,
'_'
)].
\
integration_site
.
Causality
[
payment_
transaction
.
getId
().
replace
(
'-'
,
'_'
)].
\
setDestinationReference
(
"20010101_123456"
)
setDestinationReference
(
"20010101_123456"
)
transaction_date
,
payzen_id
=
transaction
.
PaymentTransaction_getPayzenId
()
transaction_date
,
payzen_id
=
payment_
transaction
.
PaymentTransaction_getPayzenId
()
self
.
assertEquals
(
payzen_id
,
"123456"
)
self
.
assertEquals
(
payzen_id
,
"123456"
)
self
.
assertEquals
(
transaction_date
,
DateTime
(
"20010101"
))
self
.
assertEquals
(
transaction_date
,
DateTime
(
"20010101"
))
def
test_getPayzenId_REQUEST_disallowed
(
self
):
def
test_getPayzenId_REQUEST_disallowed
(
self
):
date
=
DateTime
()
payment_transaction
=
self
.
createPaymentTransaction
()
transaction
=
self
.
createPaymentTransaction
()
self
.
assertRaises
(
self
.
assertRaises
(
Unauthorized
,
Unauthorized
,
transaction
.
PaymentTransaction_getPayzenId
,
payment_
transaction
.
PaymentTransaction_getPayzenId
,
REQUEST
=
{})
REQUEST
=
{})
class
TestSlapOSPaymentTransaction_generatePayzenId
(
testSlapOSMixin
):
class
TestSlapOSPaymentTransaction_generatePayzenId
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
abort_transaction
=
1
transaction
.
abort
()
def
createPaymentTransaction
(
self
):
def
createPaymentTransaction
(
self
):
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
...
@@ -121,8 +115,8 @@ class TestSlapOSPaymentTransaction_generatePayzenId(testSlapOSMixin):
...
@@ -121,8 +115,8 @@ class TestSlapOSPaymentTransaction_generatePayzenId(testSlapOSMixin):
)
)
def
test_generatePayzenId_newPaymentTransaction
(
self
):
def
test_generatePayzenId_newPaymentTransaction
(
self
):
transaction
=
self
.
createPaymentTransaction
()
payment_
transaction
=
self
.
createPaymentTransaction
()
transaction_url
=
transaction
.
getId
().
replace
(
'-'
,
'_'
)
transaction_url
=
payment_
transaction
.
getId
().
replace
(
'-'
,
'_'
)
integration_site
=
self
.
portal
.
restrictedTraverse
(
integration_site
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredPayzenIntegrationSite
())
self
.
portal
.
portal_preferences
.
getPreferredPayzenIntegrationSite
())
...
@@ -134,7 +128,7 @@ class TestSlapOSPaymentTransaction_generatePayzenId(testSlapOSMixin):
...
@@ -134,7 +128,7 @@ class TestSlapOSPaymentTransaction_generatePayzenId(testSlapOSMixin):
category
=
integration_site
.
getMappingFromCategory
(
mapping
)
category
=
integration_site
.
getMappingFromCategory
(
mapping
)
self
.
assertEquals
(
category
,
'Causality/%s'
%
transaction_url
)
self
.
assertEquals
(
category
,
'Causality/%s'
%
transaction_url
)
transaction_date
,
payzen_id
=
transaction
.
PaymentTransaction_generatePayzenId
()
transaction_date
,
payzen_id
=
payment_
transaction
.
PaymentTransaction_generatePayzenId
()
mapping
=
integration_site
.
getCategoryFromMapping
(
mapping
=
integration_site
.
getCategoryFromMapping
(
'Causality/%s'
%
transaction_url
)
'Causality/%s'
%
transaction_url
)
...
@@ -155,34 +149,32 @@ class TestSlapOSPaymentTransaction_generatePayzenId(testSlapOSMixin):
...
@@ -155,34 +149,32 @@ class TestSlapOSPaymentTransaction_generatePayzenId(testSlapOSMixin):
def
test_generatePayzenId_mappedPaymentTransaction
(
self
):
def
test_generatePayzenId_mappedPaymentTransaction
(
self
):
transaction
=
self
.
createPaymentTransaction
()
payment_
transaction
=
self
.
createPaymentTransaction
()
transaction
.
PaymentTransaction_generatePayzenId
()
payment_
transaction
.
PaymentTransaction_generatePayzenId
()
payzen_id
=
transaction
.
PaymentTransaction_generatePayzenId
()
payzen_id
=
payment_
transaction
.
PaymentTransaction_generatePayzenId
()
self
.
assertEquals
(
payzen_id
,
(
None
,
None
))
self
.
assertEquals
(
payzen_id
,
(
None
,
None
))
def
test_generatePayzenId_increasePaymentId
(
self
):
def
test_generatePayzenId_increasePaymentId
(
self
):
transaction
=
self
.
createPaymentTransaction
()
payment_
transaction
=
self
.
createPaymentTransaction
()
transaction2
=
self
.
createPaymentTransaction
()
payment_
transaction2
=
self
.
createPaymentTransaction
()
date
,
payzen_id
=
transaction
.
PaymentTransaction_generatePayzenId
()
date
,
payzen_id
=
payment_
transaction
.
PaymentTransaction_generatePayzenId
()
date2
,
payzen_id2
=
transaction2
.
PaymentTransaction_generatePayzenId
()
date2
,
payzen_id2
=
payment_
transaction2
.
PaymentTransaction_generatePayzenId
()
self
.
assertEquals
(
date
.
asdatetime
().
strftime
(
'%Y%m%d'
),
self
.
assertEquals
(
date
.
asdatetime
().
strftime
(
'%Y%m%d'
),
date2
.
asdatetime
().
strftime
(
'%Y%m%d'
))
date2
.
asdatetime
().
strftime
(
'%Y%m%d'
))
self
.
assertNotEquals
(
payzen_id
,
payzen_id2
)
self
.
assertNotEquals
(
payzen_id
,
payzen_id2
)
self
.
assertTrue
(
int
(
payzen_id
)
<
int
(
payzen_id2
))
self
.
assertTrue
(
int
(
payzen_id
)
<
int
(
payzen_id2
))
def
test_generatePayzenId_REQUEST_disallowed
(
self
):
def
test_generatePayzenId_REQUEST_disallowed
(
self
):
date
=
DateTime
()
payment_transaction
=
self
.
createPaymentTransaction
()
transaction
=
self
.
createPaymentTransaction
()
self
.
assertRaises
(
self
.
assertRaises
(
Unauthorized
,
Unauthorized
,
transaction
.
PaymentTransaction_generatePayzenId
,
payment_
transaction
.
PaymentTransaction_generatePayzenId
,
REQUEST
=
{})
REQUEST
=
{})
class
TestSlapOSPaymentTransaction_createPayzenEvent
(
testSlapOSMixin
):
class
TestSlapOSPaymentTransaction_createPayzenEvent
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
abort_transaction
=
1
transaction
.
abort
()
def
createPaymentTransaction
(
self
):
def
createPaymentTransaction
(
self
):
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
...
@@ -193,38 +185,34 @@ class TestSlapOSPaymentTransaction_createPayzenEvent(testSlapOSMixin):
...
@@ -193,38 +185,34 @@ class TestSlapOSPaymentTransaction_createPayzenEvent(testSlapOSMixin):
)
)
def
test_createPayzenEvent_REQUEST_disallowed
(
self
):
def
test_createPayzenEvent_REQUEST_disallowed
(
self
):
date
=
DateTime
()
payment_transaction
=
self
.
createPaymentTransaction
()
transaction
=
self
.
createPaymentTransaction
()
self
.
assertRaises
(
self
.
assertRaises
(
Unauthorized
,
Unauthorized
,
transaction
.
PaymentTransaction_createPayzenEvent
,
payment_
transaction
.
PaymentTransaction_createPayzenEvent
,
REQUEST
=
{})
REQUEST
=
{})
def
test_createPayzenEvent_newPayment
(
self
):
def
test_createPayzenEvent_newPayment
(
self
):
date
=
DateTime
()
payment_transaction
=
self
.
createPaymentTransaction
()
transaction
=
self
.
createPaymentTransaction
()
payzen_event
=
payment_transaction
.
PaymentTransaction_createPayzenEvent
()
payzen_event
=
transaction
.
PaymentTransaction_createPayzenEvent
()
self
.
assertEquals
(
payzen_event
.
getPortalType
(),
"Payzen Event"
)
self
.
assertEquals
(
payzen_event
.
getPortalType
(),
"Payzen Event"
)
self
.
assertEquals
(
payzen_event
.
getSource
(),
self
.
assertEquals
(
payzen_event
.
getSource
(),
"portal_secure_payments/slapos_payzen_test"
)
"portal_secure_payments/slapos_payzen_test"
)
self
.
assertEquals
(
payzen_event
.
getDestination
(),
transaction
.
getRelativeUrl
())
self
.
assertEquals
(
payzen_event
.
getDestination
(),
payment_
transaction
.
getRelativeUrl
())
def
test_createPayzenEvent_kwParameter
(
self
):
def
test_createPayzenEvent_kwParameter
(
self
):
date
=
DateTime
()
payment_transaction
=
self
.
createPaymentTransaction
()
transaction
=
self
.
createPaymentTransaction
()
payzen_event
=
payment_transaction
.
PaymentTransaction_createPayzenEvent
(
payzen_event
=
transaction
.
PaymentTransaction_createPayzenEvent
(
title
=
'foo'
)
title
=
'foo'
)
self
.
assertEquals
(
payzen_event
.
getPortalType
(),
"Payzen Event"
)
self
.
assertEquals
(
payzen_event
.
getPortalType
(),
"Payzen Event"
)
self
.
assertEquals
(
payzen_event
.
getSource
(),
self
.
assertEquals
(
payzen_event
.
getSource
(),
"portal_secure_payments/slapos_payzen_test"
)
"portal_secure_payments/slapos_payzen_test"
)
self
.
assertEquals
(
payzen_event
.
getDestination
(),
transaction
.
getRelativeUrl
())
self
.
assertEquals
(
payzen_event
.
getDestination
(),
payment_
transaction
.
getRelativeUrl
())
self
.
assertEquals
(
payzen_event
.
getTitle
(),
"foo"
)
self
.
assertEquals
(
payzen_event
.
getTitle
(),
"foo"
)
class
TestSlapOSPayzenEvent_processUpdate
(
testSlapOSMixin
):
class
TestSlapOSPayzenEvent_processUpdate
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
abort_transaction
=
1
transaction
.
abort
()
def
createPaymentTransaction
(
self
):
def
createPaymentTransaction
(
self
):
new_id
=
self
.
generateNewId
()
new_id
=
self
.
generateNewId
()
...
@@ -240,7 +228,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -240,7 +228,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
reference
=
'PAY-%s'
%
self
.
generateNewId
())
reference
=
'PAY-%s'
%
self
.
generateNewId
())
def
test_processUpdate_REQUEST_disallowed
(
self
):
def
test_processUpdate_REQUEST_disallowed
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
self
.
assertRaises
(
self
.
assertRaises
(
Unauthorized
,
Unauthorized
,
...
@@ -249,7 +236,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -249,7 +236,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
REQUEST
=
{})
REQUEST
=
{})
def
test_processUpdate_noTransaction
(
self
):
def
test_processUpdate_noTransaction
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
self
.
assertRaises
(
self
.
assertRaises
(
AttributeError
,
AttributeError
,
...
@@ -257,7 +243,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -257,7 +243,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
'a'
,
'b'
)
'a'
,
'b'
)
def
test_processUpdate_signatureBoolean
(
self
):
def
test_processUpdate_signatureBoolean
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
event
.
edit
(
destination_value
=
payment
)
event
.
edit
(
destination_value
=
payment
)
...
@@ -267,7 +252,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -267,7 +252,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
'a'
,
'b'
)
'a'
,
'b'
)
def
test_processUpdate_falseSignature
(
self
):
def
test_processUpdate_falseSignature
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
event
.
edit
(
destination_value
=
payment
)
event
.
edit
(
destination_value
=
payment
)
...
@@ -279,7 +263,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -279,7 +263,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_wrongDataDictionnary
(
self
):
def
test_processUpdate_wrongDataDictionnary
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
event
.
edit
(
destination_value
=
payment
)
event
.
edit
(
destination_value
=
payment
)
...
@@ -289,7 +272,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -289,7 +272,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
'a'
,
True
)
'a'
,
True
)
def
test_processUpdate_unknownErrorCode
(
self
):
def
test_processUpdate_unknownErrorCode
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
event
.
edit
(
destination_value
=
payment
)
event
.
edit
(
destination_value
=
payment
)
...
@@ -305,7 +287,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -305,7 +287,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_unknownTransactionStatus
(
self
):
def
test_processUpdate_unknownTransactionStatus
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
event
.
edit
(
destination_value
=
payment
)
event
.
edit
(
destination_value
=
payment
)
...
@@ -322,7 +303,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -322,7 +303,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_notSupportedTransactionStatus
(
self
):
def
test_processUpdate_notSupportedTransactionStatus
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
event
.
edit
(
destination_value
=
payment
)
event
.
edit
(
destination_value
=
payment
)
...
@@ -340,7 +320,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -340,7 +320,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_notProcessedTransactionStatus
(
self
):
def
test_processUpdate_notProcessedTransactionStatus
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
payment
.
edit
(
start_date
=
DateTime
())
payment
.
edit
(
start_date
=
DateTime
())
...
@@ -368,7 +347,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -368,7 +347,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
payment
.
workflow_history
[
'accounting_workflow'
][
-
1
][
'comment'
])
payment
.
workflow_history
[
'accounting_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_notProcessedTransactionStatusConfirmedPayment
(
self
):
def
test_processUpdate_notProcessedTransactionStatusConfirmedPayment
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
payment
.
edit
(
start_date
=
DateTime
())
payment
.
edit
(
start_date
=
DateTime
())
...
@@ -382,7 +360,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -382,7 +360,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
event
.
PayzenEvent_processUpdate
(
data_kw
,
True
)
event
.
PayzenEvent_processUpdate
(
data_kw
,
True
)
def
test_processUpdate_noAuthAmount
(
self
):
def
test_processUpdate_noAuthAmount
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
payment
.
edit
(
start_date
=
DateTime
())
payment
.
edit
(
start_date
=
DateTime
())
...
@@ -399,7 +376,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -399,7 +376,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
data_kw
,
True
)
data_kw
,
True
)
def
test_processUpdate_noAuthDevise
(
self
):
def
test_processUpdate_noAuthDevise
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
payment
.
edit
(
start_date
=
DateTime
())
payment
.
edit
(
start_date
=
DateTime
())
...
@@ -417,7 +393,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -417,7 +393,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
data_kw
,
True
)
data_kw
,
True
)
def
test_processUpdate_differentAmount
(
self
):
def
test_processUpdate_differentAmount
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
payment
.
edit
(
start_date
=
DateTime
())
payment
.
edit
(
start_date
=
DateTime
())
...
@@ -439,7 +414,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -439,7 +414,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_differentDevise
(
self
):
def
test_processUpdate_differentDevise
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
payment
.
edit
(
payment
.
edit
(
...
@@ -463,7 +437,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -463,7 +437,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_cancelledTransaction
(
self
):
def
test_processUpdate_cancelledTransaction
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
payment
.
edit
(
payment
.
edit
(
...
@@ -488,7 +461,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
...
@@ -488,7 +461,6 @@ class TestSlapOSPayzenEvent_processUpdate(testSlapOSMixin):
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_defaultUseCase
(
self
):
def
test_processUpdate_defaultUseCase
(
self
):
date
=
DateTime
()
event
=
self
.
createPayzenEvent
()
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
payment
.
edit
(
payment
.
edit
(
...
@@ -608,8 +580,7 @@ return addToDate(DateTime(), to_add={'day': -1, 'second': -1}).toZone('UTC'), 'f
...
@@ -608,8 +580,7 @@ return addToDate(DateTime(), to_add={'day': -1, 'second': -1}).toZone('UTC'), 'f
class
TestSlapOSPayzenBase_getPayzenServiceRelativeUrl
(
testSlapOSMixin
):
class
TestSlapOSPayzenBase_getPayzenServiceRelativeUrl
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
abort_transaction
=
1
transaction
.
abort
()
def
test_getPayzenServiceRelativeUrl_REQUEST_disallowed
(
self
):
def
test_getPayzenServiceRelativeUrl_REQUEST_disallowed
(
self
):
self
.
assertRaises
(
self
.
assertRaises
(
...
@@ -623,9 +594,7 @@ class TestSlapOSPayzenBase_getPayzenServiceRelativeUrl(testSlapOSMixin):
...
@@ -623,9 +594,7 @@ class TestSlapOSPayzenBase_getPayzenServiceRelativeUrl(testSlapOSMixin):
class
TestSlapOSPayzenSaleInvoiceTransaction_createReversalPayzenTransaction
(
class
TestSlapOSPayzenSaleInvoiceTransaction_createReversalPayzenTransaction
(
testSlapOSMixin
):
testSlapOSMixin
):
abort_transaction
=
1
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
createPayzenSaleInvoiceTransaction
(
self
):
def
createPayzenSaleInvoiceTransaction
(
self
):
new_title
=
self
.
generateNewId
()
new_title
=
self
.
generateNewId
()
...
...
master/bt5/slapos_payzen/TestTemplateItem/portal_components/test.erp5.testSlapOSPayzenSkins.xml
View file @
b5dc01cc
...
@@ -6,10 +6,22 @@
...
@@ -6,10 +6,22 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSPayzenSkins
</string>
</value>
<value>
<string>
testSlapOSPayzenSkins
</string>
</value>
</item>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSlapOSPayzenSkins
</string>
</value>
<value>
<string>
test.erp5.testSlapOSPayzenSkins
</string>
</value>
...
@@ -33,43 +45,7 @@
...
@@ -33,43 +45,7 @@
<item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
W: 45, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W: 51, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W: 72, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W: 76, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W: 83, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W: 88, 6: Unused variable \'mapping\' (unused-variable)
</string>
<string>
W:103, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W:102, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:124, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W:158, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W:164, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W:175, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W:174, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:197, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W:196, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:205, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W:204, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:214, 4: Redefining name \'transaction\' from outer scope (line 2) (redefined-outer-name)
</string>
<string>
W:213, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:243, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:252, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:260, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:270, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:282, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:292, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:308, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:325, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:343, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:371, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:385, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:402, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:420, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:442, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:466, 4: Unused variable \'date\' (unused-variable)
</string>
<string>
W:491, 4: Unused variable \'date\' (unused-variable)
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -79,13 +55,28 @@
...
@@ -79,13 +55,28 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -98,7 +89,7 @@
...
@@ -98,7 +89,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -107,7 +98,7 @@
...
@@ -107,7 +98,7 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
</pickle>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment