devtools/testlib.py
branchstable
changeset 3956 5d1b8fc9cb98
parent 3913 60f31797e01e
child 3998 94cc7cad3d2d
child 4212 ab6573088b4a
--- 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: