diff markup/tests/core.py @ 21:b4d17897d053 trunk

* Include paths are now interpreted relative to the path of the including template. Closes #3. * The filename is now included as first item in the `pos` tuple of stream events. * Simplified the "basic" example so that it actually ''is'' basic. * Added a more complex example using nested relative includes in [source:/trunk/examples/includes/ examples/includes].
author cmlenz
date Tue, 20 Jun 2006 13:05:37 +0000
parents 5420cfe42d36
children b4f78c05e5c9
line wrap: on
line diff
--- a/markup/tests/core.py
+++ b/markup/tests/core.py
@@ -12,10 +12,10 @@
 # history and logs, available at http://projects.edgewall.com/trac/.
 
 import doctest
-from HTMLParser import HTMLParseError
 import unittest
 
 from markup.core import *
+from markup.input import ParseError
 
 
 class MarkupTestCase(unittest.TestCase):
@@ -123,9 +123,9 @@
         markup = Markup('<SCRIPT SRC="http://example.com/"></SCRIPT>')
         self.assertEquals('', str(markup.sanitize()))
         markup = Markup('<SCR\0IPT>alert("foo")</SCR\0IPT>')
-        self.assertRaises(HTMLParseError, markup.sanitize().render)
+        self.assertRaises(ParseError, markup.sanitize().render)
         markup = Markup('<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>')
-        self.assertRaises(HTMLParseError, markup.sanitize().render)
+        self.assertRaises(ParseError, markup.sanitize().render)
 
     def test_sanitize_remove_onclick_attr(self):
         markup = Markup('<div onclick=\'alert("foo")\' />')
@@ -156,7 +156,7 @@
         self.assertEquals('<img/>', str(markup.sanitize()))
         # Grave accents (not parsed)
         markup = Markup('<IMG SRC=`javascript:alert("RSnake says, \'foo\'")`>')
-        self.assertRaises(HTMLParseError, markup.sanitize().render)
+        self.assertRaises(ParseError, markup.sanitize().render)
         # Protocol encoded using UTF-8 numeric entities
         markup = Markup('<IMG SRC=\'&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;'
                         '&#112;&#116;&#58;alert("foo")\'>')
Copyright (C) 2012-2017 Edgewall Software