Another Step in the Quest to clean up the code base.
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
""" This should be the place to test the functinality of the random
|
||||
stuff that has been collected in the utils package. Idealy we shuld get rid
|
||||
of this random addons. """
|
||||
|
||||
import unittest
|
||||
import html_cleaner
|
||||
from utils import html_cleaner
|
||||
|
||||
|
||||
class HtmlTestCase(unittest.TestCase):
|
||||
""" Unit testcase to verify the HTML cleanup class.
|
||||
|
||||
It should removed unwanted syling tags an more get rid of dangerous
|
||||
JavaScript elements.
|
||||
"""
|
||||
|
||||
known_html = (
|
||||
('<STRONG>Fett!</STRONG>', '<strong>Fett!</strong>'),
|
||||
('<a href="link.html" onclick="do_evil()">Bad Link</a>',
|
||||
@@ -34,7 +44,7 @@ class HtmlTestCase(unittest.TestCase):
|
||||
xxx-xxxx</FONT></DIV></BODY></HTML>
|
||||
''',
|
||||
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
def test_html_cleaner(self):
|
||||
|
||||
Reference in New Issue
Block a user