[view] return HTML5 doctype. Closes #2869426
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 15 May 2013 15:37:22 +0200
changeset 8976 aeb7d400ee92
parent 8975 045e449617ad
child 8977 57e564c0118e
[view] return HTML5 doctype. Closes #2869426 We dropped xhtml support in 3.17 but we kept providing documents using the XHTML strict doctype, while our content wasn't conform to the DTD since we dropped proper namespaces definition as well as declaration of cubicweb DTD extensions.
view.py
web/test/unittest_views_basetemplates.py
--- a/view.py	Mon May 06 17:16:45 2013 +0200
+++ b/view.py	Wed May 15 15:37:22 2013 +0200
@@ -471,7 +471,7 @@
     one to display error if the first one failed
     """
 
-    doctype = STRICT_DOCTYPE
+    doctype = '<!DOCTYPE html>'
 
     def set_stream(self, w=None):
         if self.w is not None:
--- a/web/test/unittest_views_basetemplates.py	Mon May 06 17:16:45 2013 +0200
+++ b/web/test/unittest_views_basetemplates.py	Wed May 15 15:37:22 2013 +0200
@@ -15,14 +15,15 @@
 #
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
+
 from cubicweb.devtools.testlib import CubicWebTC
-from cubicweb.devtools.htmlparser import DTDValidator
+from cubicweb.devtools.htmlparser import XMLValidator
 
 
 class LogFormTemplateTC(CubicWebTC):
 
     def _login_labels(self):
-        valid = self.content_type_validators.get('text/html', DTDValidator)()
+        valid = self.content_type_validators.get('text/html', XMLValidator)()
         req = self.request()
         req.cnx.anonymous_connection = True
         page = valid.parse_string(self.vreg['views'].main_template(self.request(), 'login'))