comparison markup/tests/template.py @ 211:0a14c2a06be3

Fix another regression introduced in [258]: some kinds of cascaded match templates were broken, for example in the TurboGears example app.
author cmlenz
date Tue, 29 Aug 2006 21:14:58 +0000
parents c0c70dc5bf95
children 0a01371cecbc
comparison
equal deleted inserted replaced
210:c0c70dc5bf95 211:0a14c2a06be3
586 </html>""") 586 </html>""")
587 self.assertEqual("""<html> 587 self.assertEqual("""<html>
588 <div>I said <q>bar</q>.</div> 588 <div>I said <q>bar</q>.</div>
589 </html>""", str(tmpl.generate())) 589 </html>""", str(tmpl.generate()))
590 590
591 def test_cascaded_matches(self):
592 tmpl = Template("""<html xmlns:py="http://markup.edgewall.org/">
593 <body py:match="body">${select('*')}</body>
594 <head py:match="head">${select('title')}</head>
595 <body py:match="body">${select('*')}<hr /></body>
596 <head><title>Welcome to Markup</title></head>
597 <body><h2>Are you ready to mark up?</h2></body>
598 </html>""")
599 self.assertEqual("""<html>
600 <head><title>Welcome to Markup</title></head>
601 <body><h2>Are you ready to mark up?</h2><hr/></body>
602 </html>""", str(tmpl.generate()))
603
591 # FIXME 604 # FIXME
592 #def test_match_after_step(self): 605 #def test_match_after_step(self):
593 # tmpl = Template("""<div xmlns:py="http://markup.edgewall.org/"> 606 # tmpl = Template("""<div xmlns:py="http://markup.edgewall.org/">
594 # <span py:match="div/greeting"> 607 # <span py:match="div/greeting">
595 # Hello ${select('@name')} 608 # Hello ${select('@name')}
Copyright (C) 2012-2017 Edgewall Software