Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Léo-Paul Géneau
erp5
Commits
93472ec2
Commit
93472ec2
authored
Oct 24, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test constraints.
parent
3652385c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
bt5/erp5_payzen_secure_payment/TestTemplateItem/testERP5PayzenSecurePayment.py
...e_payment/TestTemplateItem/testERP5PayzenSecurePayment.py
+51
-0
bt5/erp5_payzen_secure_payment/bt/revision
bt5/erp5_payzen_secure_payment/bt/revision
+1
-1
No files found.
bt5/erp5_payzen_secure_payment/TestTemplateItem/testERP5PayzenSecurePayment.py
View file @
93472ec2
...
@@ -59,6 +59,57 @@ class TestERP5PayzenSecurePaymentMixin(ERP5TypeTestCase):
...
@@ -59,6 +59,57 @@ class TestERP5PayzenSecurePaymentMixin(ERP5TypeTestCase):
portal_type
=
'Payzen Service'
)
portal_type
=
'Payzen Service'
)
self
.
stepTic
()
self
.
stepTic
()
def
getMessageList
(
o
):
return
[
str
(
q
.
getMessage
())
for
q
in
o
.
checkConsistency
()]
class
TestERP5PayzenSecurePaymenConstraint
(
TestERP5PayzenSecurePaymentMixin
):
def
_test
(
self
,
message
,
prop
,
value
=
'12345'
):
self
.
assertTrue
(
message
in
getMessageList
(
self
.
service
))
self
.
service
.
edit
(
**
{
prop
:
value
})
self
.
assertFalse
(
message
in
getMessageList
(
self
.
service
))
def
test_service_username
(
self
):
self
.
_test
(
'vads_site_id have to be set'
,
'service_username'
)
def
test_service_password
(
self
):
self
.
_test
(
'Certificate has to be set.'
,
'service_password'
)
def
test_link_url_string
(
self
):
self
.
_test
(
'Payzen URL have to be set'
,
'link_url_string'
)
def
test_payzen_vads_version
(
self
):
message
=
'Payzen vads_version have to be V2'
self
.
assertRaises
(
AssertionError
,
self
.
_test
,
message
,
'payzen_vads_version'
)
self
.
_test
(
message
,
'payzen_vads_version'
,
'V2'
)
def
test_payzen_vads_page_action
(
self
):
message
=
'Payzen vads_page_action have to be one of REGISTER, '
\
'REGISTER_UPDATE, REGISTER_PAY, REGISTER_SUBSCRIBE, '
\
'REGISTER_PAY_SUBSCRIBE, PAYMENT'
self
.
assertRaises
(
AssertionError
,
self
.
_test
,
message
,
'payzen_vads_page_action'
)
for
v
in
[
'REGISTER'
,
'REGISTER_UPDATE'
,
'REGISTER_PAY'
,
'REGISTER_SUBSCRIBE'
,
'REGISTER_PAY_SUBSCRIBE'
,
'PAYMENT'
]:
self
.
_test
(
message
,
'payzen_vads_page_action'
,
v
)
self
.
service
.
edit
(
payzen_vads_page_action
=
''
)
def
test_payzen_vads_action_mode
(
self
):
message
=
'Payzen vads_action_mode have to be SILENT or INTERACTIVE'
self
.
assertRaises
(
AssertionError
,
self
.
_test
,
message
,
'payzen_vads_action_mode'
)
self
.
_test
(
message
,
'payzen_vads_action_mode'
,
'INTERACTIVE'
)
self
.
service
.
edit
(
payzen_vads_action_mode
=
''
)
self
.
_test
(
message
,
'payzen_vads_action_mode'
,
'SILENT'
)
def
test_payzen_vads_ctx_mode
(
self
):
message
=
'Payzen vads_ctx_mode have to be TEST or PRODUCTION'
self
.
assertRaises
(
AssertionError
,
self
.
_test
,
message
,
'payzen_vads_ctx_mode'
)
self
.
_test
(
message
,
'payzen_vads_ctx_mode'
,
'TEST'
)
self
.
service
.
edit
(
payzen_vads_ctx_mode
=
''
)
self
.
_test
(
message
,
'payzen_vads_ctx_mode'
,
'PRODUCTION'
)
class
TestERP5PayzenSecurePayment
(
TestERP5PayzenSecurePaymentMixin
):
class
TestERP5PayzenSecurePayment
(
TestERP5PayzenSecurePaymentMixin
):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
super
(
TestERP5PayzenSecurePayment
,
self
).
afterSetUp
()
super
(
TestERP5PayzenSecurePayment
,
self
).
afterSetUp
()
...
...
bt5/erp5_payzen_secure_payment/bt/revision
View file @
93472ec2
40
41
\ No newline at end of file
\ No newline at end of file
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