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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
eab9ddd0
Commit
eab9ddd0
authored
Jun 02, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
payment_mean: test that we can not "Select Payments" more than once at a time
parent
72b6cb84
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
bt5/erp5_payment_mean/TestTemplateItem/portal_components/test.erp5.testPaymentTransactionGroup.py
...ortal_components/test.erp5.testPaymentTransactionGroup.py
+24
-0
No files found.
bt5/erp5_payment_mean/TestTemplateItem/portal_components/test.erp5.testPaymentTransactionGroup.py
View file @
eab9ddd0
...
...
@@ -25,6 +25,7 @@
#
##############################################################################
import
urlparse
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
...
...
@@ -333,3 +334,26 @@ class TestPaymentTransactionGroupPaymentSelection(AccountingTestCase):
payment
.
bank
.
getAggregateValueList
(),
[
ptg
])
self
.
assertTrue
(
payment
.
getReference
())
def
test_select_payment_transaction_refused_when_activities_are_running
(
self
):
ptg1
=
self
.
portal
.
payment_transaction_group_module
.
newContent
(
portal_type
=
'Payment Transaction Group'
,)
ptg2
=
self
.
portal
.
payment_transaction_group_module
.
newContent
(
portal_type
=
'Payment Transaction Group'
,)
self
.
tic
()
ret
=
ptg1
.
PaymentTransactionGroup_selectPaymentTransactionLineList
(
select_mode
=
'stopped_or_delivered'
)
self
.
assertEqual
(
urlparse
.
parse_qs
(
urlparse
.
urlparse
(
ret
).
query
)[
'portal_status_message'
],
[
'Payment selection in progress.'
])
self
.
commit
()
ret
=
ptg1
.
PaymentTransactionGroup_selectPaymentTransactionLineList
(
select_mode
=
'stopped_or_delivered'
)
self
.
assertEqual
(
urlparse
.
parse_qs
(
urlparse
.
urlparse
(
ret
).
query
)[
'portal_status_message'
],
[
'Some payments are still beeing processed in the background, please retry later'
])
self
.
commit
()
# another PTG is same, because we also want to prevent things like two users selecting
# payments at the same time.
ret
=
ptg2
.
PaymentTransactionGroup_selectPaymentTransactionLineList
(
select_mode
=
'stopped_or_delivered'
)
self
.
assertEqual
(
urlparse
.
parse_qs
(
urlparse
.
urlparse
(
ret
).
query
)[
'portal_status_message'
],
[
'Some payments are still beeing processed in the background, please retry later'
])
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