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
Titouan Soulard
erp5
Commits
e83e0362
Commit
e83e0362
authored
Apr 15, 2021
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! AcceleratedHTTPCacheManager: do nothing if object is not directly published.
parent
bb49d24a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
...tTemplateItem/portal_components/test.erp5.testERP5Type.py
+38
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
View file @
e83e0362
...
@@ -33,6 +33,7 @@ except ImportError: # BBB: ZODB < 4
...
@@ -33,6 +33,7 @@ except ImportError: # BBB: ZODB < 4
import
unittest
import
unittest
import
sys
import
sys
import
mock
import
mock
import
requests
import
transaction
import
transaction
from
random
import
randint
from
random
import
randint
...
@@ -3204,6 +3205,43 @@ return [
...
@@ -3204,6 +3205,43 @@ return [
'<Organisation at /%s/organisation_module/organisation_id>'
%
self
.
portal
.
getId
(),
'<Organisation at /%s/organisation_module/organisation_id>'
%
self
.
portal
.
getId
(),
repr
(
document
))
repr
(
document
))
def
test_AcceleratedHTTPCacheManager
(
self
):
"""
Check if Accelerated HTTP Cache Manager is effective only if the object itself is
directly published.
"""
portal
=
self
.
getPortalObject
()
script_container
=
portal
.
portal_skins
.
custom
script_id
=
'test_AcceleratedHTTPCacheManager'
createZODBPythonScript
(
script_container
,
script_id
,
''
,
'''
traverse = context.getPortalObject().restrictedTraverse
request = context.REQUEST
response = request.RESPONSE
dtml_method = traverse('erp5.css')
dtml_document = traverse('erp5.js')
page_template = traverse('erp5_tabber.js')
file_ = traverse('rsvp.js')
image = traverse('favicon.ico')
dtml_method()
dtml_document()
page_template()
file_.index_html(request, response)
image.index_html(request, response)
return 'OK'
'''
)
self
.
commit
()
try
:
portal_url
=
self
.
portal
.
absolute_url
()
for
path
in
(
'erp5.css'
,
'erp5.js'
,
'erp5_tabber.js'
,
'rsvp.js'
,
'favicon.ico'
):
response
=
requests
.
get
(
'%s/%s'
%
(
portal_url
,
path
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertIn
(
'Cache-Control'
,
response
.
headers
)
response
=
requests
.
get
(
'%s/%s'
%
(
portal_url
,
script_id
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertNotIn
(
'Cache-Control'
,
response
.
headers
)
finally
:
removeZODBPythonScript
(
script_container
,
script_id
)
class
TestAccessControl
(
ERP5TypeTestCase
):
class
TestAccessControl
(
ERP5TypeTestCase
):
# Isolate test in a dedicaced class in order not to break other tests
# Isolate test in a dedicaced class in order not to break other tests
# when this one fails.
# when this one fails.
...
...
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