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
7
Merge Requests
7
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
Jérome Perrin
erp5
Commits
be74f8ba
Commit
be74f8ba
authored
Apr 09, 2021
by
Aurel
Committed by
Kazuhiko Shiozaki
Jul 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zope4: manage_delObjects now raises BadRequest.
* Emtpy parameter. * No argument.
parent
542079e7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
13 deletions
+45
-13
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testProxyField.py
...emplateItem/portal_components/test.erp5.testProxyField.py
+5
-1
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
+10
-4
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/TestTool_cleanUpTestResults.py
...al_skins/erp5_ui_test_core/TestTool_cleanUpTestResults.py
+5
-1
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_addZuite.py
...lateItem/portal_skins/erp5_ui_test_core/Zuite_addZuite.py
+5
-2
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+10
-2
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testProxyField.py
View file @
be74f8ba
...
...
@@ -32,6 +32,7 @@ from unittest import expectedFailure
from
lxml
import
etree
from
Products.Formulator.FormToXML
import
formToXML
from
Products.Formulator.TALESField
import
TALESMethod
from
zExceptions
import
BadRequest
from
Products.Formulator.XMLToForm
import
XMLToForm
from
Products.ERP5Form.ProxyField
import
BrokenProxyField
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
...
...
@@ -57,7 +58,10 @@ class TestProxyField(ERP5TypeTestCase):
"""Remove objects created in tests."""
# Remove forms
custom_folder
=
self
.
getSkinsTool
().
custom
try
:
custom_folder
.
manage_delObjects
(
custom_folder
.
objectIds
())
except
BadRequest
:
pass
# Remove skin folders
if
'erp5_geek'
in
self
.
getSkinsTool
().
objectIds
():
...
...
bt5/erp5_invoicing/TestTemplateItem/portal_components/test.erp5.testRule.py
View file @
be74f8ba
...
...
@@ -29,6 +29,7 @@ import unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
erp5.component.test.testOrder
import
TestOrderMixin
from
zExceptions
import
BadRequest
class
TestRuleMixin
(
TestOrderMixin
):
"""
...
...
@@ -52,13 +53,19 @@ class TestRuleMixin(TestOrderMixin):
return
rule
def
_wipe
(
self
,
folder
):
try
:
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
except
BadRequest
:
pass
def
afterSetUp
(
self
):
# delete rules
rule_tool
=
self
.
portal
.
portal_rules
try
:
rule_tool
.
manage_delObjects
(
ids
=
[
x
.
getId
()
for
x
in
rule_tool
.
objectValues
()
if
x
.
getVersion
().
startswith
(
'testRule.'
)])
except
BadRequest
:
pass
# recreate rules
self
.
createRule
(
'default_order_rule'
,
'1'
)
self
.
createRule
(
'default_delivery_rule'
,
'1'
)
...
...
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testInventory.py
View file @
be74f8ba
...
...
@@ -54,6 +54,7 @@ from erp5.component.test.testOrder import TestOrderMixin
from
Products.ERP5Form.Selection
import
DomainSelection
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
textwrap
import
dedent
from
zExceptions
import
BadRequest
class
TestInventory
(
TestOrderMixin
,
ERP5TypeTestCase
):
"""
...
...
@@ -115,10 +116,15 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
for
module
in
[
'portal_simulation'
,
'inventory_module'
]:
folder
=
self
.
portal
[
module
]
try
:
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
except
BadRequest
:
pass
try
:
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
list
(
self
.
portal
.
portal_skins
.
custom
.
objectIds
()))
except
BadRequest
:
pass
self
.
tic
()
def
createCategory
(
self
,
parent
,
id_list
):
...
...
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/TestTool_cleanUpTestResults.py
View file @
be74f8ba
from
zExceptions
import
BadRequest
portal_tests
=
container
.
portal_tests
if
test_zuite_relative_url
is
not
None
:
# we care for a specific test zuite
portal_tests
=
portal_tests
.
restrictedTraverse
(
test_zuite_relative_url
,
\
portal_tests
)
# remove test results from previous test runs
portal_tests
.
manage_delObjects
([
x
.
getId
()
\
try
:
portal_tests
.
manage_delObjects
([
x
.
getId
()
\
for
x
in
portal_tests
.
objectValues
(
'Zuite Results'
)])
except
BadRequest
:
pass
print
"OK"
return
printed
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_addZuite.py
View file @
be74f8ba
"""
Create a zuite or return an existing one after remove his contents.
"""
from
zExceptions
import
BadRequest
assert
context
.
getPortalType
()
==
"Test Tool"
,
"bad context"
if
REQUEST
:
raise
RuntimeError
(
"You can not call this script from the URL"
)
...
...
@@ -16,6 +17,8 @@ zuite = getattr(context.portal_tests, zuite_id)
if
zuite
.
getMetaType
()
!=
"ERP5 Test Tool"
:
raise
ValueError
(
"Zuite is not a ERP5 Test Tool"
)
zuite
.
manage_delObjects
(
zuite
.
objectIds
())
try
:
zuite
.
manage_delObjects
(
zuite
.
objectIds
())
except
BadRequest
:
pass
return
zuite
product/ERP5/tests/testInventoryAPI.py
View file @
be74f8ba
...
...
@@ -43,6 +43,8 @@ from MySQLdb import ProgrammingError
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
reindex
from
zExceptions
import
BadRequest
import
six
class
InventoryAPITestCase
(
ERP5TypeTestCase
):
...
...
@@ -130,8 +132,14 @@ class InventoryAPITestCase(ERP5TypeTestCase):
'inventory_module'
,
self
.
folder
.
getId
()
]:
folder
=
self
.
portal
[
module
]
try
:
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
except
BadRequest
:
pass
try
:
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
list
(
self
.
portal
.
portal_skins
.
custom
.
objectIds
()))
except
BadRequest
:
pass
self
.
tic
()
...
...
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