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
140
Merge Requests
140
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
ef183cfe
Commit
ef183cfe
authored
Apr 17, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core_test/testERP5Type: target Zope 4 when running ZPublisher tests
parent
e6ba8144
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
67 deletions
+29
-67
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
...tTemplateItem/portal_components/test.erp5.testERP5Type.py
+29
-67
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
View file @
ef183cfe
...
@@ -3258,6 +3258,13 @@ class TestAccessControl(ERP5TypeTestCase):
...
@@ -3258,6 +3258,13 @@ class TestAccessControl(ERP5TypeTestCase):
def
test
(
self
):
def
test
(
self
):
self
.
portal
.
person_module
.
newContent
(
immediate_reindex
=
True
)
self
.
portal
.
person_module
.
newContent
(
immediate_reindex
=
True
)
def
add_tests
(
suite
,
module
):
if
hasattr
(
module
,
'test_suite'
):
return
suite
.
addTest
(
module
.
test_suite
())
for
obj
in
vars
(
module
).
values
():
if
isinstance
(
obj
,
type
)
and
issubclass
(
obj
,
unittest
.
TestCase
):
suite
.
addTest
(
unittest
.
makeSuite
(
obj
))
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
...
@@ -3266,91 +3273,46 @@ def test_suite():
...
@@ -3266,91 +3273,46 @@ def test_suite():
# run tests for monkey patched ZPublisher modules
# run tests for monkey patched ZPublisher modules
import
ZPublisher.tests.testBaseRequest
import
ZPublisher.tests.testBaseRequest
suite
.
addTest
(
ZPublisher
.
tests
.
testBaseRequest
.
test_suite
()
)
add_tests
(
suite
,
ZPublisher
.
tests
.
testBaseRequest
)
import
ZPublisher.tests.testBeforeTraverse
import
ZPublisher.tests.testBeforeTraverse
suite
.
addTest
(
ZPublisher
.
tests
.
testBeforeTraverse
.
test_suite
()
)
add_tests
(
suite
,
ZPublisher
.
tests
.
testBeforeTraverse
)
import
ZPublisher.tests.testHTTPRangeSupport
import
ZPublisher.tests.testHTTPRangeSupport
suite
.
addTest
(
ZPublisher
.
tests
.
testHTTPRangeSupport
.
test_suite
()
)
add_tests
(
suite
,
ZPublisher
.
tests
.
testHTTPRangeSupport
)
import
ZPublisher.tests.testHTTPRequest
import
ZPublisher.tests.testHTTPRequest
# ERP5 processes requests as utf-8 by default, but we adjust this test assuming that
add_tests
(
suite
,
ZPublisher
.
tests
.
testHTTPRequest
)
# default is iso-8859-15
def
forceISO885915DefaultRequestCharset
(
method
):
def
wrapped
(
self
):
from
ZPublisher
import
HTTPRequest
as
module
old_encoding
=
module
.
default_encoding
module
.
default_encoding
=
'iso-8859-15'
try
:
return
method
(
self
)
finally
:
module
.
default_encoding
=
old_encoding
return
wrapped
ZPublisher
.
tests
.
testHTTPRequest
.
HTTPRequestTests
.
test_processInputs_w_unicode_conversions
=
forceISO885915DefaultRequestCharset
(
ZPublisher
.
tests
.
testHTTPRequest
.
HTTPRequestTests
.
test_processInputs_w_unicode_conversions
)
suite
.
addTest
(
ZPublisher
.
tests
.
testHTTPRequest
.
test_suite
())
import
ZPublisher.tests.testHTTPResponse
import
ZPublisher.tests.testHTTPResponse
# ERP5 forces utf-8 responses by default, but we adjust these tests so that they run
testHTTPResponse_TestHeaderEncodingRegistry_test_encode_words
=
\
# with iso-8859-15 as default response charset
ZPublisher
.
tests
.
testHTTPResponse
.
TestHeaderEncodingRegistry
.
test_encode_words
def
forceISO885915DefaultResponseCharset
(
method
):
ZPublisher
.
tests
.
testHTTPResponse
.
TestHeaderEncodingRegistry
.
test_encode_words
=
\
def
wrapped
(
self
):
unittest
.
expectedFailure
(
testHTTPResponse_TestHeaderEncodingRegistry_test_encode_words
)
# here we can use this utility method which clean up at teardown
add_tests
(
suite
,
ZPublisher
.
tests
.
testHTTPResponse
)
self
.
_setDefaultEncoding
(
'iso-8859-15'
)
return
method
(
self
)
return
wrapped
HTTPResponseTests
=
ZPublisher
.
tests
.
testHTTPResponse
.
HTTPResponseTests
HTTPResponseTests
.
test___str__w_body
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test___str__w_body
)
HTTPResponseTests
.
test_ctor_charset_no_content_type_header
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_ctor_charset_no_content_type_header
)
HTTPResponseTests
.
test_ctor_charset_text_header_no_charset_defaults_latin1
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_ctor_charset_text_header_no_charset_defaults_latin1
)
HTTPResponseTests
.
test_ctor_charset_unicode_body_application_header
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_ctor_charset_unicode_body_application_header
)
HTTPResponseTests
.
test_listHeaders_w_body
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_listHeaders_w_body
)
HTTPResponseTests
.
test_setBody_2_tuple_w_is_error_converted_to_Site_Error
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_setBody_2_tuple_w_is_error_converted_to_Site_Error
)
HTTPResponseTests
.
test_setBody_2_tuple_wo_is_error_converted_to_HTML
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_setBody_2_tuple_wo_is_error_converted_to_HTML
)
HTTPResponseTests
.
test_setBody_object_with_asHTML
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_setBody_object_with_asHTML
)
HTTPResponseTests
.
test_setBody_object_with_unicode
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_setBody_object_with_unicode
)
HTTPResponseTests
.
test_setBody_string_HTML
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_setBody_string_HTML
)
HTTPResponseTests
.
test_setBody_string_not_HTML
=
forceISO885915DefaultResponseCharset
(
HTTPResponseTests
.
test_setBody_string_not_HTML
)
suite
.
addTest
(
ZPublisher
.
tests
.
testHTTPResponse
.
test_suite
())
import
ZPublisher.tests.testIterators
import
ZPublisher.tests.testIterators
suite
.
addTest
(
ZPublisher
.
tests
.
testIterators
.
test_suite
()
)
add_tests
(
suite
,
ZPublisher
.
tests
.
testIterators
)
import
ZPublisher.tests.testPostTraversal
import
ZPublisher.tests.testPostTraversal
suite
.
addTest
(
ZPublisher
.
tests
.
testPostTraversal
.
test_suite
())
add_tests
(
suite
,
ZPublisher
.
tests
.
testPostTraversal
)
import
ZPublisher.tests.testPublish
suite
.
addTest
(
ZPublisher
.
tests
.
testPublish
.
test_suite
())
import
ZPublisher.tests.test_Converters
import
ZPublisher.tests.test_Converters
suite
.
addTest
(
ZPublisher
.
tests
.
test_Converters
.
test_suite
())
add_tests
(
suite
,
ZPublisher
.
tests
.
test_Converters
)
# XXX don't run test_WSGIPublisher for now because too many failures
# import ZPublisher.tests.test_WSGIPublisher
# suite.addTest(ZPublisher.tests.test_WSGIPublisher.test_suite())
# XXX don't run test_exception_handling because we have incompatible zope.testbrowser version
import
ZPublisher.tests.test_WSGIPublisher
# import ZPublisher.tests.test_exception_handling
add_tests
(
suite
,
ZPublisher
.
tests
.
test_WSGIPublisher
)
import
ZPublisher.tests.test_mapply
import
ZPublisher.tests.test_mapply
suite
.
addTest
(
ZPublisher
.
tests
.
test_mapply
.
test_suite
()
)
add_tests
(
suite
,
ZPublisher
.
tests
.
test_mapply
)
import
ZPublisher.tests.test_xmlrpc
import
ZPublisher.tests.test_pubevents
suite
.
addTest
(
ZPublisher
.
tests
.
test_xmlrpc
.
test_suite
())
add_tests
(
suite
,
ZPublisher
.
tests
.
test_pubevents
)
import
ZPublisher.tests.test_utils
add_tests
(
suite
,
ZPublisher
.
tests
.
test_utils
)
import
ZPublisher.tests.test
pubevents
import
ZPublisher.tests.test
_xmlrpc
suite
.
addTest
(
ZPublisher
.
tests
.
testpubevents
.
test_suite
()
)
add_tests
(
suite
,
ZPublisher
.
tests
.
test_xmlrpc
)
return
suite
return
suite
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