Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
3652385c
Commit
3652385c
authored
Oct 24, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test navigate method.
parent
fee06a6d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
bt5/erp5_payzen_secure_payment/TestTemplateItem/testERP5PayzenSecurePayment.py
...e_payment/TestTemplateItem/testERP5PayzenSecurePayment.py
+35
-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 @
3652385c
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
import
hashlib
import
hashlib
import
DateTime
import
DateTime
import
random
def
sha1
(
s
):
def
sha1
(
s
):
return
hashlib
.
sha1
(
s
).
hexdigest
()
return
hashlib
.
sha1
(
s
).
hexdigest
()
...
@@ -122,3 +123,37 @@ class TestERP5PayzenSecurePayment(TestERP5PayzenSecurePaymentMixin):
...
@@ -122,3 +123,37 @@ class TestERP5PayzenSecurePayment(TestERP5PayzenSecurePaymentMixin):
)
)
# dict was updated with passed format
# dict was updated with passed format
self
.
assertEqual
(
d
[
'keyDaTe'
],
now
.
strftime
(
'%Y-%m-%dT%H:%M:%S'
))
self
.
assertEqual
(
d
[
'keyDaTe'
],
now
.
strftime
(
'%Y-%m-%dT%H:%M:%S'
))
def
test_navigate
(
self
):
self
.
service
.
edit
(
link_url_string
=
'http://payzen/'
,
payzen_vads_action_mode
=
'INTERACTIVE'
,
payzen_vads_ctx_mode
=
'TEST'
,
payzen_vads_page_action
=
'REGISTER'
,
payzen_vads_version
=
'V2'
,
service_username
=
'0123456'
)
pt_id
=
str
(
random
.
random
())
self
.
portal
.
portal_skins
.
custom
.
manage_addProduct
[
'PageTemplates'
]
\
.
manage_addPageTemplate
(
id
=
pt_id
,
text
=
'''<tal:block tal:repeat="value here/field_list">key=<tal:block tal:replace="python: value[0]"/> value=<tal:block tal:replace="python: value[1]"/>
</tal:block>'''
)
# flush skin cache
self
.
portal
.
changeSkin
(
None
)
try
:
result
=
self
.
service
.
navigate
(
pt_id
,
{
"key"
:
'value'
})
signature
=
sha1
(
'value+INTERACTIVE+ERP5+TEST+REGISTER+SINGLE+0123456+V2+'
+
self
.
service_password
)
self
.
assertEqual
(
result
,
"""key=vads_site_id value=0123456
key=vads_payment_config value=SINGLE
key=vads_action_mode value=INTERACTIVE
key=vads_contrib value=ERP5
key=vads_page_action value=REGISTER
key=vads_ctx_mode value=TEST
key=key value=value
key=signature value=%s
key=vads_version value=V2
"""
%
signature
)
finally
:
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
([
pt_id
])
# flush skin cache
self
.
portal
.
changeSkin
(
None
)
bt5/erp5_payzen_secure_payment/bt/revision
View file @
3652385c
39
40
\ 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