devtools/testlib.py
changeset 562 bdadb26c4a3c
parent 549 cd2bdcc16430
child 563 a690996639ca
--- a/devtools/testlib.py	Mon Feb 09 11:55:32 2009 +0100
+++ b/devtools/testlib.py	Mon Feb 09 14:09:55 2009 +0100
@@ -93,6 +93,7 @@
     #  SaxOnlyValidator : guarantees XML is well formed
     #  None : do not try to validate anything
     # validators used must be imported from from.devtools.htmlparser
+    valmap = {None: None, 'dtd': DTDValidator, 'xml': SaxOnlyValidator}
     content_type_validators = {
         # maps MIME type : validator name
         #
@@ -109,18 +110,12 @@
         'application/json': None,
         'image/png': None,
         }
-    vid_validators = {
-        # maps vid : validator name (override content_type_validators)
-        }
-    valmap = {None: None, 'dtd': DTDValidator, 'xml': SaxOnlyValidator}
+    # maps vid : validator name (override content_type_validators)
+    vid_validators = dict((vid, valmap[valkey])
+                          for vid, valkey in VIEW_VALIDATORS.iteritems())
+    
     no_auto_populate = ()
-    ignored_relations = ()
-    
-    def __init__(self, *args, **kwargs):
-        self.validators = {}
-        EnvBasedTC.__init__(self, *args, **kwargs)
-        for view, valkey in VIEW_VALIDATORS.iteritems():
-            self.validators[view] = self.valmap[valkey]
+    ignored_relations = ()    
         
     def custom_populate(self, how_many, cursor):
         pass