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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
erp5
Commits
31b4a4d6
Commit
31b4a4d6
authored
Apr 09, 2021
by
Aurel
Committed by
Jérome Perrin
Mar 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zope4: manage_delObjects now raises BadRequest.
* Emtpy parameter. * No argument.
parent
03be548a
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 @
31b4a4d6
...
@@ -32,6 +32,7 @@ from unittest import expectedFailure
...
@@ -32,6 +32,7 @@ from unittest import expectedFailure
from
lxml
import
etree
from
lxml
import
etree
from
Products.Formulator.FormToXML
import
formToXML
from
Products.Formulator.FormToXML
import
formToXML
from
Products.Formulator.TALESField
import
TALESMethod
from
Products.Formulator.TALESField
import
TALESMethod
from
zExceptions
import
BadRequest
from
Products.Formulator.XMLToForm
import
XMLToForm
from
Products.Formulator.XMLToForm
import
XMLToForm
from
Products.ERP5Form.ProxyField
import
BrokenProxyField
from
Products.ERP5Form.ProxyField
import
BrokenProxyField
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
...
@@ -57,7 +58,10 @@ class TestProxyField(ERP5TypeTestCase):
...
@@ -57,7 +58,10 @@ class TestProxyField(ERP5TypeTestCase):
"""Remove objects created in tests."""
"""Remove objects created in tests."""
# Remove forms
# Remove forms
custom_folder
=
self
.
getSkinsTool
().
custom
custom_folder
=
self
.
getSkinsTool
().
custom
try
:
custom_folder
.
manage_delObjects
(
custom_folder
.
objectIds
())
custom_folder
.
manage_delObjects
(
custom_folder
.
objectIds
())
except
BadRequest
:
pass
# Remove skin folders
# Remove skin folders
if
'erp5_geek'
in
self
.
getSkinsTool
().
objectIds
():
if
'erp5_geek'
in
self
.
getSkinsTool
().
objectIds
():
...
...
bt5/erp5_invoicing/TestTemplateItem/portal_components/test.erp5.testRule.py
View file @
31b4a4d6
...
@@ -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 @
31b4a4d6
...
@@ -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,10 +116,15 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
...
@@ -115,10 +116,15 @@ 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
try
:
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
()))
except
BadRequest
:
pass
self
.
tic
()
self
.
tic
()
def
createCategory
(
self
,
parent
,
id_list
):
def
createCategory
(
self
,
parent
,
id_list
):
...
...
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/TestTool_cleanUpTestResults.py
View file @
31b4a4d6
from
zExceptions
import
BadRequest
portal_tests
=
container
.
portal_tests
portal_tests
=
container
.
portal_tests
if
test_zuite_relative_url
is
not
None
:
if
test_zuite_relative_url
is
not
None
:
# we care for a specific test zuite
# we care for a specific test zuite
portal_tests
=
portal_tests
.
restrictedTraverse
(
test_zuite_relative_url
,
\
portal_tests
=
portal_tests
.
restrictedTraverse
(
test_zuite_relative_url
,
\
portal_tests
)
portal_tests
)
# remove test results from previous test runs
# 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'
)])
for
x
in
portal_tests
.
objectValues
(
'Zuite Results'
)])
except
BadRequest
:
pass
print
"OK"
print
"OK"
return
printed
return
printed
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_addZuite.py
View file @
31b4a4d6
"""
"""
Create a zuite or return an existing one after remove his contents.
Create a zuite or return an existing one after remove his contents.
"""
"""
from
zExceptions
import
BadRequest
assert
context
.
getPortalType
()
==
"Test Tool"
,
"bad context"
assert
context
.
getPortalType
()
==
"Test Tool"
,
"bad context"
if
REQUEST
:
if
REQUEST
:
raise
RuntimeError
(
"You can not call this script from the URL"
)
raise
RuntimeError
(
"You can not call this script from the URL"
)
...
@@ -16,6 +17,8 @@ zuite = getattr(context.portal_tests, zuite_id)
...
@@ -16,6 +17,8 @@ zuite = getattr(context.portal_tests, zuite_id)
if
zuite
.
getMetaType
()
!=
"ERP5 Test Tool"
:
if
zuite
.
getMetaType
()
!=
"ERP5 Test Tool"
:
raise
ValueError
(
"Zuite is not a 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
return
zuite
product/ERP5/tests/testInventoryAPI.py
View file @
31b4a4d6
...
@@ -43,6 +43,8 @@ from MySQLdb import ProgrammingError
...
@@ -43,6 +43,8 @@ from MySQLdb import ProgrammingError
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
reindex
from
Products.ERP5Type.tests.utils
import
reindex
from
zExceptions
import
BadRequest
import
six
import
six
class
InventoryAPITestCase
(
ERP5TypeTestCase
):
class
InventoryAPITestCase
(
ERP5TypeTestCase
):
...
@@ -130,8 +132,14 @@ class InventoryAPITestCase(ERP5TypeTestCase):
...
@@ -130,8 +132,14 @@ class InventoryAPITestCase(ERP5TypeTestCase):
'inventory_module'
,
'inventory_module'
,
self
.
folder
.
getId
()
]:
self
.
folder
.
getId
()
]:
folder
=
self
.
portal
[
module
]
folder
=
self
.
portal
[
module
]
try
:
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
folder
.
manage_delObjects
(
list
(
folder
.
objectIds
()))
except
BadRequest
:
pass
try
:
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
list
(
self
.
portal
.
portal_skins
.
custom
.
objectIds
()))
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
list
(
self
.
portal
.
portal_skins
.
custom
.
objectIds
()))
except
BadRequest
:
pass
self
.
tic
()
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