[Checkins] SVN: DocumentTemplate/trunk/ Copy in the code

Hanno Schlichting hannosch at hannosch.eu
Sat Jun 19 13:17:04 EDT 2010


Log message for revision 113679:
  Copy in the code
  

Changed:
  _U  DocumentTemplate/trunk/
  A   DocumentTemplate/trunk/src/DocumentTemplate/
  U   DocumentTemplate/trunk/src/DocumentTemplate/tests/testDTML.py
  A   DocumentTemplate/trunk/src/TreeDisplay/
  U   DocumentTemplate/trunk/src/TreeDisplay/TreeTag.py

-=-

Property changes on: DocumentTemplate/trunk
___________________________________________________________________
Added: svn:ignore
   + develop-eggs
eggs
fake-eggs
bin
parts
downloads
var
build
dist
local.cfg
*.egg-info
.installed.cfg
*.pyc
.Python
include
lib


Modified: DocumentTemplate/trunk/src/DocumentTemplate/tests/testDTML.py
===================================================================
--- Zope/trunk/src/DocumentTemplate/tests/testDTML.py	2010-06-19 17:05:56 UTC (rev 113675)
+++ DocumentTemplate/trunk/src/DocumentTemplate/tests/testDTML.py	2010-06-19 17:17:04 UTC (rev 113679)
@@ -305,57 +305,6 @@
             spam='<a href="spam">\nfoo bar')
         self.assertEqual(res,expected)
 
-    def test_fmt_reST_include_directive_raises(self):
-        source = '.. include:: /etc/passwd'
-        html = self.doc_class('<dtml-var name="foo" fmt="restructured-text">')
-        html._vars['foo'] = source
-        result = html()
-
-        # The include: directive hasn't been rendered, it remains
-        # verbatimly in the rendered output.  Instead a warning
-        # message is presented:
-        self.assert_(source in result)
-        self.assert_(docutils_include_warning in result)
-
-    def test_fmt_reST_raw_directive_disabled(self):
-        from cgi import escape
-        EXPECTED = '<h1>HELLO WORLD</h1>'
-        source = '.. raw:: html\n\n  %s\n' % EXPECTED
-        html = self.doc_class('<dtml-var name="foo" fmt="restructured-text">')
-        html._vars['foo'] = source
-        result = html()
-
-        # The raw: directive hasn't been rendered, it remains
-        # verbatimly in the rendered output.  Instead a warning
-        # message is presented:
-        self.assert_(EXPECTED not in result)
-        self.assert_(escape(EXPECTED) in result)
-        self.assert_(docutils_raw_warning in result)
-
-    def test_fmt_reST_raw_directive_file_option_raises(self):
-        source = '.. raw:: html\n  :file: inclusion.txt'
-        html = self.doc_class('<dtml-var name="foo" fmt="restructured-text">')
-        html._vars['foo'] = source
-        result = html()
-
-        # The raw: directive hasn't been rendered, it remains
-        # verbatimly in the rendered output.  Instead a warning
-        # message is presented:
-        self.assert_(source in result)
-        self.assert_(docutils_raw_warning in result)
-
-    def test_fmt_reST_raw_directive_url_option_raises(self):
-        source = '.. raw:: html\n  :url: http://www.zope.org'
-        html = self.doc_class('<dtml-var name="foo" fmt="restructured-text">')
-        html._vars['foo'] = source
-        result = html()
-
-        # The raw: directive hasn't been rendered, it remains
-        # verbatimly in the rendered output.  Instead a warning
-        # message is presented:
-        self.assert_(source in result)
-        self.assert_(docutils_raw_warning in result)
-
     def testPropogatedError(self):
         from ExtensionClass import Base
 
@@ -552,6 +501,60 @@
         assert expected == result, result
 
 
+class RESTTests(DTMLTests):
+
+    def test_fmt_reST_include_directive_raises(self):
+        source = '.. include:: /etc/passwd'
+        html = self.doc_class('<dtml-var name="foo" fmt="restructured-text">')
+        html._vars['foo'] = source
+        result = html()
+
+        # The include: directive hasn't been rendered, it remains
+        # verbatimly in the rendered output.  Instead a warning
+        # message is presented:
+        self.assert_(source in result)
+        self.assert_(docutils_include_warning in result)
+
+    def test_fmt_reST_raw_directive_disabled(self):
+        from cgi import escape
+        EXPECTED = '<h1>HELLO WORLD</h1>'
+        source = '.. raw:: html\n\n  %s\n' % EXPECTED
+        html = self.doc_class('<dtml-var name="foo" fmt="restructured-text">')
+        html._vars['foo'] = source
+        result = html()
+
+        # The raw: directive hasn't been rendered, it remains
+        # verbatimly in the rendered output.  Instead a warning
+        # message is presented:
+        self.assert_(EXPECTED not in result)
+        self.assert_(escape(EXPECTED) in result)
+        self.assert_(docutils_raw_warning in result)
+
+    def test_fmt_reST_raw_directive_file_option_raises(self):
+        source = '.. raw:: html\n  :file: inclusion.txt'
+        html = self.doc_class('<dtml-var name="foo" fmt="restructured-text">')
+        html._vars['foo'] = source
+        result = html()
+
+        # The raw: directive hasn't been rendered, it remains
+        # verbatimly in the rendered output.  Instead a warning
+        # message is presented:
+        self.assert_(source in result)
+        self.assert_(docutils_raw_warning in result)
+
+    def test_fmt_reST_raw_directive_url_option_raises(self):
+        source = '.. raw:: html\n  :url: http://www.zope.org'
+        html = self.doc_class('<dtml-var name="foo" fmt="restructured-text">')
+        html._vars['foo'] = source
+        result = html()
+
+        # The raw: directive hasn't been rendered, it remains
+        # verbatimly in the rendered output.  Instead a warning
+        # message is presented:
+        self.assert_(source in result)
+        self.assert_(docutils_raw_warning in result)
+
+
 def read_file(name):
     import os
     from DocumentTemplate import tests
@@ -583,5 +586,11 @@
 
 def test_suite():
     suite = unittest.TestSuite()
-    suite.addTest( unittest.makeSuite( DTMLTests ) )
+    suite.addTest(unittest.makeSuite(DTMLTests))
+    try:
+        import reStructuredText
+    except ImportError:
+        pass
+    else:
+        suite.addTest(unittest.makeSuite(RESTTests))
     return suite

Modified: DocumentTemplate/trunk/src/TreeDisplay/TreeTag.py
===================================================================
--- Zope/trunk/src/TreeDisplay/TreeTag.py	2010-06-19 17:09:18 UTC (rev 113676)
+++ DocumentTemplate/trunk/src/TreeDisplay/TreeTag.py	2010-06-19 17:17:04 UTC (rev 113679)
@@ -12,20 +12,14 @@
 ##############################################################################
 """Rendering object hierarchies as Trees
 """
-__rcs_id__='$Id$'
-__version__='$Revision: 1.58 $'[11:-2]
 
 from binascii import a2b_base64
 from binascii import b2a_base64
 from cPickle import dumps
-import re
 from string import translate
-from urllib import quote
-from urllib import unquote
 from zlib import compress
 from zlib import decompressobj
 
-#from DocumentTemplate.DT_Util import *
 from DocumentTemplate.DT_Util import add_with_prefix
 from DocumentTemplate.DT_Util import Eval
 from DocumentTemplate.DT_Util import InstanceDict



More information about the checkins mailing list