fix test on systems that don't have simpleTAL installed tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 18 Feb 2009 17:27:08 +0100
branchtls-sprint
changeset 821 78cc1682c3a4
parent 820 fcc11122ffe7
child 822 e3d8db01f3f5
fix test on systems that don't have simpleTAL installed
test/unittest_entity.py
--- a/test/unittest_entity.py	Wed Feb 18 17:23:54 2009 +0100
+++ b/test/unittest_entity.py	Wed Feb 18 17:27:08 2009 +0100
@@ -4,7 +4,9 @@
 from cubicweb.devtools.apptest import EnvBasedTC
 
 from mx.DateTime import DateTimeType, now
+
 from cubicweb import Binary
+from cubicweb.common.mttransforms import HAS_TAL
 
 class EntityTC(EnvBasedTC):
 
@@ -301,11 +303,6 @@
         self.assertEquals(e.printable_value('content'),
                           '<p>\ndu *texte*\n</p>')
         e['title'] = 'zou'
-        e['content'] = '<h1 tal:content="self/title">titre</h1>'
-        e['content_format'] = 'text/cubicweb-page-template'
-        self.assertEquals(e.printable_value('content'),
-                          '<h1>zou</h1>')
-        
         #e = self.etype_instance('Task')
         e['content'] = '''\
 a title
@@ -319,6 +316,12 @@
         e['content_format'] = 'text/html'
         self.assertEquals(e.printable_value('content', format='text/plain').strip(),
                           u'**yo (zou éà ;)**')
+        if HAS_TAL:
+            e['content'] = '<h1 tal:content="self/title">titre</h1>'
+            e['content_format'] = 'text/cubicweb-page-template'
+            self.assertEquals(e.printable_value('content'),
+                              '<h1>zou</h1>')
+        
 
     def test_printable_value_bytes(self):
         e = self.add_entity('File', data=Binary('lambda x: 1'), data_format=u'text/x-python',