ERP5Type/tests: review requests in tests
Jérome Perrin authored
The general idea of this patch is that now that we are using
zope.globalrequest, we no longer need to patch get_request, we can
simply call zope.globalrequest.setRequest with the request from the
test and restore the "real" request afterwards.

To achieve this, we reuse Testing.ZopeTestCase.connections.registry,
which already has the logic of cleaning up resources in the right place
and use a "Request" resource that calls setRequest(test_request) and
setRequest(real_request) when closed, so that:
 - test runs with an independant request
 - this test request is closed at the end
 - the real request is restored at the end

This also fixes a bug with self.publish when runnning
ERP5TypeLiveTestCase from portal_components of a running instance,
after a call to self.publish the current request was lost.

The testing for this revealed that ERP5TypeLiveTestCase.publish way
of dealing with zope.security interaction was not always correct: when
running a live test inside run...
3b874e49
Name Last commit Last update
cloudooo_data
cloudooo_web
erp5_access_token
erp5_accounting
erp5_accounting_l10n_br_extend
erp5_accounting_l10n_br_sme
erp5_accounting_l10n_cn_basic
erp5_accounting_l10n_de_skr04
erp5_accounting_l10n_fr
erp5_accounting_l10n_fr_m14
erp5_accounting_l10n_fr_m4
erp5_accounting_l10n_fr_pca
erp5_accounting_l10n_ifrs
erp5_accounting_l10n_in
erp5_accounting_l10n_lu
erp5_accounting_l10n_mt
erp5_accounting_l10n_pl
erp5_accounting_l10n_pl_default_gap
erp5_accounting_l10n_ru
erp5_accounting_l10n_sn
erp5_accounting_renderjs_ui_test
erp5_accounting_ui_test
erp5_administration
erp5_advanced_ecommerce
erp5_advanced_ecommerce_test
erp5_advanced_invoicing
erp5_advanced_trade
erp5_advanced_trade_invoicing
erp5_api_style
erp5_apparel
erp5_archive
erp5_authentication_policy
erp5_autocompletion_ui
erp5_bank_reconciliation
erp5_bank_reconciliation_renderjs_ui_test
erp5_barcode
erp5_base
erp5_bearer_token
erp5_big_file
erp5_budget
erp5_calendar
erp5_certificate_authority
erp5_ci_slideshow
erp5_code_mirror
erp5_commerce
erp5_commerce_loyalty_program
erp5_commerce_loyalty_program_test
erp5_computer_immobilisation
erp5_configurator
erp5_configurator_ebusiness_lotse
erp5_configurator_maxma_demo
erp5_configurator_run_my_doc
erp5_configurator_standard
erp5_configurator_standard_accounting_template
erp5_configurator_standard_categories
erp5_configurator_standard_invoicing_template
erp5_configurator_standard_solver
erp5_configurator_standard_trade_template
erp5_configurator_standard_ui_test
erp5_consulting
erp5_content_translation
erp5_core_proxy_field_legacy
erp5_core_test
erp5_corporate_identity
erp5_corporate_identity_renderjs_ui_test
erp5_corporate_identity_test
erp5_credential
erp5_credential_oauth2
erp5_crm
erp5_crm_knowledge_pad
erp5_crm_renderjs_ui_test
erp5_crm_ui_test
erp5_csv_style
erp5_data_notebook
erp5_data_protection
erp5_data_set
erp5_datepicker_ui
erp5_deferred_renderjs_ui_test
erp5_deferred_style
erp5_demo_maxma_rule
erp5_demo_maxma_sample
erp5_demo_smb
erp5_development_wizard
erp5_dhtml_style
erp5_dhtml_ui_test
erp5_dhtmlx_scheduler
erp5_direct_debit_payment
erp5_discount_resource
erp5_discussion
erp5_dms
erp5_dms_conversion_catalog
erp5_dms_ui_test
erp5_document_scanner
erp5_document_scanner_ui_test
erp5_dummy_movement
erp5_email_reader
erp5_external_account
erp5_font
erp5_forge
erp5_forum_tutorial