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
139
Merge Requests
139
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
e4103b73
Commit
e4103b73
authored
Aug 20, 2020
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testERP5WebWithDms: rollback the change in Caching Policy Manager not to affect following tests.
parent
246d3c85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
25 deletions
+28
-25
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testERP5WebWithDms.py
...ateItem/portal_components/test.erp5.testERP5WebWithDms.py
+28
-25
No files found.
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testERP5WebWithDms.py
View file @
e4103b73
...
...
@@ -655,31 +655,34 @@ class TestERP5WebWithDms(ERP5TypeTestCase, ZopeTestCase.Functional):
# Those images can be accessible through extensible content
# url : path-of-document + '/' + 'img' + page-index + '.png'
# Update policy to have stale values
self
.
portal
.
caching_policy_manager
.
_updatePolicy
(
"unauthenticated no language"
,
"python: member is None"
,
"python: getattr(object, 'getModificationDate', object.modified)()"
,
1200
,
30
,
600
,
0
,
0
,
0
,
"Accept-Language, Cookie"
,
""
,
None
,
0
,
1
,
0
,
0
,
1
,
1
,
None
,
None
)
self
.
tic
()
policy_list
=
self
.
portal
.
caching_policy_manager
.
listPolicies
()
policy
=
[
policy
[
1
]
for
policy
in
policy_list
\
if
policy
[
0
]
==
'unauthenticated no language'
][
0
]
# Check policy has been updated
self
.
assertEquals
(
policy
.
getMaxAgeSecs
(),
1200
)
self
.
assertEquals
(
policy
.
getStaleWhileRevalidateSecs
(),
30
)
self
.
assertEquals
(
policy
.
getStaleIfErrorSecs
(),
600
)
for
i
in
xrange
(
3
):
path
=
'/'
.
join
((
website_url
,
reference
,
'img%s.png'
%
i
))
response
=
self
.
publish
(
path
)
self
.
assertEquals
(
response
.
getHeader
(
'Content-Type'
),
'image/png'
)
self
.
assertEquals
(
response
.
getHeader
(
'Cache-Control'
),
'max-age=%d, stale-while-revalidate=%d, stale-if-error=%d, public'
%
\
(
policy
.
getMaxAgeSecs
(),
policy
.
getStaleWhileRevalidateSecs
(),
policy
.
getStaleIfErrorSecs
()))
policy_orig
=
self
.
portal
.
caching_policy_manager
.
_policies
[
'unauthenticated no language'
]
try
:
self
.
portal
.
caching_policy_manager
.
_updatePolicy
(
"unauthenticated no language"
,
"python: member is None"
,
"python: getattr(object, 'getModificationDate', object.modified)()"
,
1200
,
30
,
600
,
0
,
0
,
0
,
"Accept-Language, Cookie"
,
""
,
None
,
0
,
1
,
0
,
0
,
1
,
1
,
None
,
None
)
self
.
tic
()
policy_list
=
self
.
portal
.
caching_policy_manager
.
listPolicies
()
policy
=
[
policy
[
1
]
for
policy
in
policy_list
\
if
policy
[
0
]
==
'unauthenticated no language'
][
0
]
# Check policy has been updated
self
.
assertEquals
(
policy
.
getMaxAgeSecs
(),
1200
)
self
.
assertEquals
(
policy
.
getStaleWhileRevalidateSecs
(),
30
)
self
.
assertEquals
(
policy
.
getStaleIfErrorSecs
(),
600
)
for
i
in
xrange
(
3
):
path
=
'/'
.
join
((
website_url
,
reference
,
'img%s.png'
%
i
))
response
=
self
.
publish
(
path
)
self
.
assertEquals
(
response
.
getHeader
(
'Content-Type'
),
'image/png'
)
self
.
assertEquals
(
response
.
getHeader
(
'Cache-Control'
),
'max-age=%d, stale-while-revalidate=%d, stale-if-error=%d, public'
%
\
(
policy
.
getMaxAgeSecs
(),
policy
.
getStaleWhileRevalidateSecs
(),
policy
.
getStaleIfErrorSecs
()))
finally
:
self
.
portal
.
caching_policy_manager
.
_policies
[
'unauthenticated no language'
]
=
policy_orig
def
test_PreviewOOoDocumentWithEmbeddedImage
(
self
):
"""Tests html preview of an OOo document with images as extensible content.
...
...
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