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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
727b3458
Commit
727b3458
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
947080de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
25 deletions
+29
-25
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testERP5WebWithDms.py
...ateItem/portal_components/test.erp5.testERP5WebWithDms.py
+29
-25
No files found.
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testERP5WebWithDms.py
View file @
727b3458
...
@@ -655,31 +655,35 @@ class TestERP5WebWithDms(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -655,31 +655,35 @@ class TestERP5WebWithDms(ERP5TypeTestCase, ZopeTestCase.Functional):
# Those images can be accessible through extensible content
# Those images can be accessible through extensible content
# url : path-of-document + '/' + 'img' + page-index + '.png'
# url : path-of-document + '/' + 'img' + page-index + '.png'
# Update policy to have stale values
# Update policy to have stale values
self
.
portal
.
caching_policy_manager
.
_updatePolicy
(
policy_orig
=
self
.
portal
.
caching_policy_manager
.
_policies
[
'unauthenticated no language'
]
"unauthenticated no language"
,
"python: member is None"
,
try
:
"python: getattr(object, 'getModificationDate', object.modified)()"
,
self
.
portal
.
caching_policy_manager
.
_updatePolicy
(
1200
,
30
,
600
,
0
,
0
,
0
,
"Accept-Language, Cookie"
,
""
,
None
,
"unauthenticated no language"
,
"python: member is None"
,
0
,
1
,
0
,
0
,
1
,
1
,
None
,
None
)
"python: getattr(object, 'getModificationDate', object.modified)()"
,
self
.
tic
()
1200
,
30
,
600
,
0
,
0
,
0
,
"Accept-Language, Cookie"
,
""
,
None
,
policy_list
=
self
.
portal
.
caching_policy_manager
.
listPolicies
()
0
,
1
,
0
,
0
,
1
,
1
,
None
,
None
)
policy
=
[
policy
[
1
]
for
policy
in
policy_list
\
self
.
tic
()
if
policy
[
0
]
==
'unauthenticated no language'
][
0
]
policy_list
=
self
.
portal
.
caching_policy_manager
.
listPolicies
()
# Check policy has been updated
policy
=
[
policy
[
1
]
for
policy
in
policy_list
\
self
.
assertEqual
(
policy
.
getMaxAgeSecs
(),
1200
)
if
policy
[
0
]
==
'unauthenticated no language'
][
0
]
self
.
assertEqual
(
policy
.
getStaleWhileRevalidateSecs
(),
30
)
# Check policy has been updated
self
.
assertEqual
(
policy
.
getStaleIfErrorSecs
(),
600
)
self
.
assertEqual
(
policy
.
getMaxAgeSecs
(),
1200
)
for
i
in
xrange
(
3
):
self
.
assertEqual
(
policy
.
getStaleWhileRevalidateSecs
(),
30
)
path
=
'/'
.
join
((
website_url
,
self
.
assertEqual
(
policy
.
getStaleIfErrorSecs
(),
600
)
reference
,
for
i
in
xrange
(
3
):
'img%s.png'
%
i
))
path
=
'/'
.
join
((
website_url
,
response
=
self
.
publish
(
path
)
reference
,
self
.
assertEqual
(
response
.
getHeader
(
'Content-Type'
),
'image/png'
)
'img%s.png'
%
i
))
self
.
assertEqual
(
response
.
getHeader
(
'Cache-Control'
),
response
=
self
.
publish
(
path
)
'max-age=%d, stale-while-revalidate=%d, stale-if-error=%d, public'
%
\
self
.
assertEqual
(
response
.
getHeader
(
'Content-Type'
),
'image/png'
)
(
policy
.
getMaxAgeSecs
(),
self
.
assertEqual
(
response
.
getHeader
(
'Cache-Control'
),
policy
.
getStaleWhileRevalidateSecs
(),
'max-age=%d, stale-while-revalidate=%d, stale-if-error=%d, public'
%
\
policy
.
getStaleIfErrorSecs
()))
(
policy
.
getMaxAgeSecs
(),
policy
.
getStaleWhileRevalidateSecs
(),
policy
.
getStaleIfErrorSecs
()))
finally
:
self
.
portal
.
caching_policy_manager
.
_policies
[
'unauthenticated no language'
]
=
policy_orig
transaction
.
commit
()
def
test_PreviewOOoDocumentWithEmbeddedImage
(
self
):
def
test_PreviewOOoDocumentWithEmbeddedImage
(
self
):
"""Tests html preview of an OOo document with images as extensible content.
"""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