Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
985698b2
Commit
985698b2
authored
Dec 17, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add checks for content-type
parent
fc400dc2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
...thon/Products/PageTemplates/tests/testZopePageTemplate.py
+19
-8
No files found.
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
View file @
985698b2
...
@@ -96,28 +96,39 @@ class ZopePageTemplateFileTests(ZopeTestCase):
...
@@ -96,28 +96,39 @@ class ZopePageTemplateFileTests(ZopeTestCase):
REQUEST
=
self
.
app
.
REQUEST
REQUEST
=
self
.
app
.
REQUEST
REQUEST
.
set
(
'BODY'
,
text
)
REQUEST
.
set
(
'BODY'
,
text
)
zpt
.
PUT
(
REQUEST
,
REQUEST
.
RESPONSE
)
zpt
.
PUT
(
REQUEST
,
REQUEST
.
RESPONSE
)
return
zpt
.
output_encoding
return
zpt
def
testPutHTMLIso8859_15WithCharsetInfo
(
self
):
def
testPutHTMLIso8859_15WithCharsetInfo
(
self
):
self
.
assertEqual
(
self
.
_put
(
html_iso_8859_15_w_header
),
'iso-8859-15'
)
zpt
=
self
.
_put
(
html_iso_8859_15_w_header
)
self
.
assertEqual
(
zpt
.
output_encoding
,
'iso-8859-15'
)
self
.
assertEqual
(
zpt
.
content_type
,
'text/html'
)
def
testPutHTMLUTF8_WithCharsetInfo
(
self
):
def
testPutHTMLUTF8_WithCharsetInfo
(
self
):
self
.
assertEqual
(
self
.
_put
(
html_utf8_w_header
),
'utf-8'
)
zpt
=
self
.
_put
(
html_utf8_w_header
)
self
.
assertEqual
(
zpt
.
output_encoding
,
'utf-8'
)
self
.
assertEqual
(
zpt
.
content_type
,
'text/html'
)
def
testPutHTMLIso8859_15WithoutCharsetInfo
(
self
):
def
testPutHTMLIso8859_15WithoutCharsetInfo
(
self
):
self
.
assertEqual
(
self
.
_put
(
html_iso_8859_15_wo_header
),
'iso-8859-15'
)
zpt
=
self
.
_put
(
html_iso_8859_15_wo_header
)
self
.
assertEqual
(
zpt
.
output_encoding
,
'iso-8859-15'
)
self
.
assertEqual
(
zpt
.
content_type
,
'text/html'
)
def
testPutHTMLUTF8_WithoutCharsetInfo
(
self
):
def
testPutHTMLUTF8_WithoutCharsetInfo
(
self
):
import
pdb
;
pdb
.
set_trace
()
zpt
=
self
.
_put
(
html_utf8_wo_header
)
self
.
assertEqual
(
self
.
_put
(
html_utf8_wo_header
),
'iso-8859-15'
)
self
.
assertEqual
(
zpt
.
output_encoding
,
'iso-8859-15'
)
self
.
assertEqual
(
zpt
.
content_type
,
'text/html'
)
def
testPutXMLIso8859_15
(
self
):
def
testPutXMLIso8859_15
(
self
):
""" XML: use always UTF-8 als output encoding """
""" XML: use always UTF-8 als output encoding """
self
.
assertEqual
(
self
.
_put
(
xml_iso_8859_15
),
'utf-8'
)
zpt
=
self
.
_put
(
xml_iso_8859_15
)
self
.
assertEqual
(
zpt
.
output_encoding
,
'utf-8'
)
self
.
assertEqual
(
zpt
.
content_type
,
'text/xml'
)
def
testPutXMLUTF8
(
self
):
def
testPutXMLUTF8
(
self
):
""" XML: use always UTF-8 als output encoding """
""" XML: use always UTF-8 als output encoding """
self
.
assertEqual
(
self
.
_put
(
xml_utf8
),
'utf-8'
)
zpt
=
self
.
_put
(
xml_utf8
)
self
.
assertEqual
(
zpt
.
output_encoding
,
'utf-8'
)
self
.
assertEqual
(
zpt
.
content_type
,
'text/xml'
)
class
ZPTRegressions
(
unittest
.
TestCase
):
class
ZPTRegressions
(
unittest
.
TestCase
):
...
...
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