[web] Make tests pass if tal isn't available
authorRémi Cardona <remi.cardona@free.fr>
Sun, 20 Dec 2015 19:08:19 +0100
changeset 11013 645fcb5bcc39
parent 11012 739943455c9d
child 11014 9c9f5e913f9c
[web] Make tests pass if tal isn't available
web/test/unittest_form.py
--- a/web/test/unittest_form.py	Mon Dec 21 15:52:41 2015 +0100
+++ b/web/test/unittest_form.py	Sun Dec 20 19:08:19 2015 +0100
@@ -26,6 +26,7 @@
 from logilab.common.testlib import unittest_main
 
 from cubicweb import Binary, ValidationError
+from cubicweb.mttransforms import HAS_TAL
 from cubicweb.devtools.testlib import CubicWebTC
 from cubicweb.web.formfields import (IntField, StringField, RichTextField,
                                      PasswordField, DateTimeField,
@@ -195,8 +196,9 @@
         with self.admin_access.web_request() as req:
             req.use_fckeditor = lambda: False
             self._test_richtextfield(req, '''<select id="description_format-subject:%(eid)s" name="description_format-subject:%(eid)s" size="1" style="display: block" tabindex="1">
-<option value="text/cubicweb-page-template">text/cubicweb-page-template</option>
-<option selected="selected" value="text/html">text/html</option>
+''' + ('<option value="text/cubicweb-page-template">text/cubicweb-page-template</option>\n'
+if HAS_TAL else '') +
+'''<option selected="selected" value="text/html">text/html</option>
 <option value="text/markdown">text/markdown</option>
 <option value="text/plain">text/plain</option>
 <option value="text/rest">text/rest</option>