changeset 174:a395c11cbced trunk

Added test case for includes without a search path.
author cmlenz
date Sun, 20 Aug 2006 11:41:58 +0000
parents 128005041637
children 7f96149f28d5
files markup/tests/template.py
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/markup/tests/template.py
+++ b/markup/tests/template.py
@@ -744,6 +744,28 @@
               <div>Included</div>
             </html>""", tmpl.generate().render())
 
+    def test_relative_include_without_search_path(self):
+        file1 = open(os.path.join(self.dirname, 'tmpl1.html'), 'w')
+        try:
+            file1.write("""<div>Included</div>""")
+        finally:
+            file1.close()
+
+        file2 = open(os.path.join(self.dirname, 'tmpl2.html'), 'w')
+        try:
+            file2.write("""<html xmlns:xi="http://www.w3.org/2001/XInclude">
+              <xi:include href="tmpl1.html" />
+            </html>""")
+        finally:
+            file2.close()
+
+        loader = TemplateLoader()
+        tmpl = loader.load(os.path.abspath(os.path.join(self.dirname,
+                                                        'tmpl2.html')))
+        self.assertEqual("""<html>
+              <div>Included</div>
+            </html>""", tmpl.generate().render())
+
 
 def suite():
     suite = unittest.TestSuite()
Copyright (C) 2012-2017 Edgewall Software