Commits

megamahi committed b0e549a

Added validator test

  • Participants
  • Parent commits e68bf9d

Comments (0)

Files changed (2)

File tests/test_exceptions.py

 def test_exception_no_id():
     w = tw2.tinymce.TinyMCEWidget()
     try:
-        w.display()
+        print w.display()
         assert(False)
     except ValueError as e:
-        assert(str(e) == 'QRCodeWidget must be supplied an id')
+        assert(str(e) == 'TinyMCEWidget must be supplied an id')
 
 def test_exception_bad_locale():
     w = tw2.tinymce.TinyMCEWidget(id="test", locale="klingon")

File tests/test_validator.py

+from tw2.core.testbase import  ValidatorTest
+import tw2.tinymce
+
+class TestDemoWidget(ValidatorTest):
+    # place your widget at the TestWidget attribute
+    validator = tw2.tinymce.MarkupConverter
+
+    # Initilization args. go here
+    to_python_attrs = [{}, {}, {}, {}]
+    to_python_params = [
+        """No HTML here""",
+        """<a href="this is a link">A Link!</a>""",
+        """<h1>THIS IS LOUD.</h1><br/>""",
+        """<h1>THIS IS LOUD.</h1><br />"""]
+    to_python_expected = [
+        """No HTML here""",
+        """<a href="this is a link">A Link!</a>""",
+        """<h1>THIS IS LOUD.</h1>""",
+        """<h1>THIS IS LOUD.</h1>"""]