summaryrefslogtreecommitdiff
path: root/test/DocutilsTestSupport.py
diff options
context:
space:
mode:
authorgoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-04-26 03:57:00 +0000
committergoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-04-26 03:57:00 +0000
commitc9498b49320c431256f63dd857d631fbc05e2f3a (patch)
tree8b0fa0b205b285bb292495d2350b52e88430d546 /test/DocutilsTestSupport.py
parent68f1a0cd0296f8727c2f222bc4b700d8fe4cbd92 (diff)
downloaddocutils-c9498b49320c431256f63dd857d631fbc05e2f3a.tar.gz
Added ``html_prolog`` & ``html_head`` to HTML writer parts dictionary exposed by ``docutils.core.publish_parts``; updated tests & docs. At the request of Marcelo Huerta.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@3257 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/DocutilsTestSupport.py')
-rw-r--r--test/DocutilsTestSupport.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/DocutilsTestSupport.py b/test/DocutilsTestSupport.py
index 40ac89c4f..87a200598 100644
--- a/test/DocutilsTestSupport.py
+++ b/test/DocutilsTestSupport.py
@@ -731,12 +731,17 @@ class HtmlWriterPublishPartsTestCase(WriterPublishTestCase):
expected = self.expected % {'version': docutils.__version__}
self.compare_output(self.input, output, expected)
- standard_meta_value = """\
+ standard_meta_value_template = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils %s: http://docutils.sourceforge.net/" />
-""" % docutils.__version__
+"""
+ standard_meta_value = standard_meta_value_template % docutils.__version__
standard_stylesheet_value = ('<link rel="stylesheet" href="default.css" '
'type="text/css" />\n')
+ standard_html_prolog = """\
+<?xml version="1.0" encoding="%s" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+"""
def format_output(self, parts):
"""Minimize & standardize the output."""
@@ -748,6 +753,10 @@ class HtmlWriterPublishPartsTestCase(WriterPublishTestCase):
parts['meta'] = parts['meta'].replace(self.standard_meta_value, '')
if parts['stylesheet'] == self.standard_stylesheet_value:
del parts['stylesheet']
+ parts['html_head'] = parts['html_head'].replace(
+ self.standard_meta_value, '...')
+ parts['html_prolog'] = parts['html_prolog'].replace(
+ self.standard_html_prolog, '')
# remove empty values:
for key in parts.keys():
if not parts[key]: