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
Labels
Merge Requests
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
d6b28ab6
Commit
d6b28ab6
authored
May 25, 2021
by
Aurel
Committed by
Arnaud Fontaine
Jan 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manage_delObject raise when no ids given
parent
15924f5c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
bt5/erp5_invoicing/TestTemplateItem/portal_components/test.erp5.testRule.py
.../TestTemplateItem/portal_components/test.erp5.testRule.py
+10
-3
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventory.py
...TemplateItem/portal_components/test.erp5.testInventory.py
+5
-1
No files found.
bt5/erp5_invoicing/TestTemplateItem/portal_components/test.erp5.testRule.py
View file @
d6b28ab6
...
@@ -29,6 +29,7 @@ import unittest
...
@@ -29,6 +29,7 @@ import unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
erp5.component.test.testOrder
import
TestOrderMixin
from
erp5.component.test.testOrder
import
TestOrderMixin
from
zExceptions
import
BadRequest
class
TestRuleMixin
(
TestOrderMixin
):
class
TestRuleMixin
(
TestOrderMixin
):
"""
"""
...
@@ -52,13 +53,19 @@ class TestRuleMixin(TestOrderMixin):
...
@@ -52,13 +53,19 @@ class TestRuleMixin(TestOrderMixin):
return
rule
return
rule
def
_wipe
(
self
,
folder
):
def
_wipe
(
self
,
folder
):
try
:
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
except
BadRequest
:
pass
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
# delete rules
# delete rules
rule_tool
=
self
.
portal
.
portal_rules
rule_tool
=
self
.
portal
.
portal_rules
try
:
rule_tool
.
manage_delObjects
(
ids
=
[
x
.
getId
()
for
x
in
rule_tool
.
objectValues
()
rule_tool
.
manage_delObjects
(
ids
=
[
x
.
getId
()
for
x
in
rule_tool
.
objectValues
()
if
x
.
getVersion
().
startswith
(
'testRule.'
)])
if
x
.
getVersion
().
startswith
(
'testRule.'
)])
except
BadRequest
:
pass
# recreate rules
# recreate rules
self
.
createRule
(
'default_order_rule'
,
'1'
)
self
.
createRule
(
'default_order_rule'
,
'1'
)
self
.
createRule
(
'default_delivery_rule'
,
'1'
)
self
.
createRule
(
'default_delivery_rule'
,
'1'
)
...
...
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventory.py
View file @
d6b28ab6
...
@@ -54,6 +54,7 @@ from erp5.component.test.testOrder import TestOrderMixin
...
@@ -54,6 +54,7 @@ from erp5.component.test.testOrder import TestOrderMixin
from
Products.ERP5Form.Selection
import
DomainSelection
from
Products.ERP5Form.Selection
import
DomainSelection
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
textwrap
import
dedent
from
textwrap
import
dedent
from
zExceptions
import
BadRequest
class
TestInventory
(
TestOrderMixin
,
ERP5TypeTestCase
):
class
TestInventory
(
TestOrderMixin
,
ERP5TypeTestCase
):
"""
"""
...
@@ -115,7 +116,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
...
@@ -115,7 +116,10 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
for
module
in
[
'portal_simulation'
,
for
module
in
[
'portal_simulation'
,
'inventory_module'
]:
'inventory_module'
]:
folder
=
self
.
portal
[
module
]
folder
=
self
.
portal
[
module
]
try
:
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
except
BadRequest
:
pass
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
list
(
self
.
portal
.
portal_skins
.
custom
.
objectIds
()))
list
(
self
.
portal
.
portal_skins
.
custom
.
objectIds
()))
...
...
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