# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1234184995 -3600 # Node ID bdadb26c4a3cf6163632baadac96cf767be13a75 # Parent 4bbeb62ba9556c8cb1ff2d47e00dd2f630b9c79a old .validators attribute is now .vid_validators diff -r 4bbeb62ba955 -r bdadb26c4a3c devtools/testlib.py --- 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