don't use html/dtd validator as default validator for non html views. Closes #550162 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 01 Dec 2009 12:06:17 +0100
branchstable
changeset 3956 5d1b8fc9cb98
parent 3955 235a9fda6058
child 3957 4a71754bf5eb
don't use html/dtd validator as default validator for non html views. Closes #550162
devtools/testlib.py
--- a/devtools/testlib.py	Tue Dec 01 12:03:42 2009 +0100
+++ b/devtools/testlib.py	Tue Dec 01 12:06:17 2009 +0100
@@ -165,10 +165,13 @@
         try:
             validatorclass = self.vid_validators[view.id]
         except KeyError:
-            if template is None:
-                default_validator = HTMLValidator
+            if view.content_type in ('text/html', 'application/xhtml+xml'):
+                if template is None:
+                    default_validator = HTMLValidator
+                else:
+                    default_validator = DTDValidator
             else:
-                default_validator = DTDValidator
+                default_validator = None
             validatorclass = self.content_type_validators.get(view.content_type,
                                                               default_validator)
         if validatorclass is None: