don't use html/dtd validator as default validator for non html views. Closes #550162

authorSylvain Th?nault <sylvain.thenault@logilab.fr>
changeset5d1b8fc9cb98
branchstable
phasepublic
hiddenno
parent revision#235a9fda6058 support x.set_relations(a_relation=None) to delete a_relation relations from this entity
child revision#4a71754bf5eb oops, this is an object relation
files modified by this revision
devtools/testlib.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1259665577 -3600
# Tue Dec 01 12:06:17 2009 +0100
# Branch stable
# Node ID 5d1b8fc9cb98591ba9aa5c974ed4e836302a4514
# Parent 235a9fda60583a2ddb90886860a76c8ac67a476a
don't use html/dtd validator as default validator for non html views. Closes #550162

diff --git a/devtools/testlib.py b/devtools/testlib.py
@@ -163,14 +163,17 @@
1      def _check_html(self, output, view, template='main-template'):
2          """raises an exception if the HTML is invalid"""
3          try:
4              validatorclass = self.vid_validators[view.id]
5          except KeyError:
6 -            if template is None:
7 -                default_validator = HTMLValidator
8 +            if view.content_type in ('text/html', 'application/xhtml+xml'):
9 +                if template is None:
10 +                    default_validator = HTMLValidator
11 +                else:
12 +                    default_validator = DTDValidator
13              else:
14 -                default_validator = DTDValidator
15 +                default_validator = None
16              validatorclass = self.content_type_validators.get(view.content_type,
17                                                                default_validator)
18          if validatorclass is None:
19              return None
20          validator = validatorclass()