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
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
131cd004
Commit
131cd004
authored
Dec 03, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Attempt to reduce flakiness
It ensure that selected payment is from the proper user.
parent
ca466637
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
...omponents/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
+11
-19
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
View file @
131cd004
...
...
@@ -654,6 +654,11 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
portal_type
=
'Open Sale Order Line'
)
self
.
assertEqual
(
len
(
line_list
),
0
)
def
findMessage
(
self
,
email
,
body
):
for
candidate
in
reversed
(
self
.
portal
.
MailHost
.
getMessageList
()):
if
[
q
for
q
in
candidate
[
1
]
if
email
in
q
]
and
body
in
candidate
[
2
]:
return
candidate
[
2
]
@
changeSkin
(
'RJS'
)
def
useWechatManually
(
self
,
web_site
,
user_id
,
is_email_expected
=
True
):
...
...
@@ -663,25 +668,19 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self
.
assertNotEqual
(
person
,
None
)
# User received an email for payment
email
=
person
.
getDefaultEmailText
()
def
findMessage
(
email
,
body
):
for
candidate
in
reversed
(
self
.
portal
.
MailHost
.
getMessageList
()):
if
[
q
for
q
in
candidate
[
1
]
if
email
in
q
]
and
body
in
candidate
[
2
]:
return
candidate
[
2
]
to_click_message
=
findMessage
(
email
,
'A new invoice has been generated.'
)
to_click_message
=
self
.
findMessage
(
person
.
getDefaultEmailText
(),
'A new invoice has been generated'
)
if
is_email_expected
:
self
.
assertNotEqual
(
None
,
to_click_message
)
else
:
self
.
assertEqual
(
None
,
to_click_message
)
# If you are using live test, be aware that the call of the alarm can be
# not enough for the number of objects on the site.
document_id
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Payment Transaction"
,
simulation_state
=
"started"
,
destination_section_uid
=
person
.
getUid
()
).
getId
()
web_site
.
accounting_module
[
document_id
].
\
...
...
@@ -689,21 +688,13 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
@
changeSkin
(
'RJS'
)
def
usePayzenManually
(
self
,
web_site
,
user_id
,
is_email_expected
=
True
):
person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Person"
,
user_id
=
user_id
)
self
.
assertNotEqual
(
person
,
None
)
# User received an email for payment
email
=
person
.
getDefaultEmailText
()
def
findMessage
(
email
,
body
):
for
candidate
in
reversed
(
self
.
portal
.
MailHost
.
getMessageList
()):
if
[
q
for
q
in
candidate
[
1
]
if
email
in
q
]
and
body
in
candidate
[
2
]:
return
candidate
[
2
]
to_click_message
=
findMessage
(
email
,
'A new invoice has been generated.'
)
to_click_message
=
self
.
findMessage
(
person
.
getDefaultEmailText
(),
'A new invoice has been generated'
)
if
is_email_expected
:
self
.
assertNotEqual
(
None
,
to_click_message
)
...
...
@@ -716,6 +707,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
document_id
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Payment Transaction"
,
simulation_state
=
"started"
,
destination_section_uid
=
person
.
getUid
()
).
getId
()
web_site
.
accounting_module
[
document_id
].
\
...
...
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