test/unittest_entity.py
changeset 6173 eb386e473044
parent 6142 8bc6eac1fac1
parent 6168 a52ea49434c8
child 6366 1806148d6ce8
equal deleted inserted replaced
6162:76bd320c5ace 6173:eb386e473044
    14 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    14 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    15 # details.
    15 # details.
    16 #
    16 #
    17 # You should have received a copy of the GNU Lesser General Public License along
    17 # You should have received a copy of the GNU Lesser General Public License along
    18 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    19 """unit tests for cubicweb.web.views.entities module
    19 """unit tests for cubicweb.web.views.entities module"""
    20 
       
    21 """
       
    22 
    20 
    23 from datetime import datetime
    21 from datetime import datetime
    24 
    22 
    25 from cubicweb import Binary, Unauthorized
    23 from cubicweb import Binary, Unauthorized
    26 from cubicweb.devtools.testlib import CubicWebTC
    24 from cubicweb.devtools.testlib import CubicWebTC
   327         self.assertEquals(e.printable_value('content'),
   325         self.assertEquals(e.printable_value('content'),
   328                           'du <em>html</em> <a href="http://testing.fr/cubicweb/view?rql=CWUser%20X">users</a>')
   326                           'du <em>html</em> <a href="http://testing.fr/cubicweb/view?rql=CWUser%20X">users</a>')
   329         e.cw_attr_cache['content'] = 'du *texte*'
   327         e.cw_attr_cache['content'] = 'du *texte*'
   330         e.cw_attr_cache['content_format'] = 'text/plain'
   328         e.cw_attr_cache['content_format'] = 'text/plain'
   331         self.assertEquals(e.printable_value('content'),
   329         self.assertEquals(e.printable_value('content'),
   332                           '<p>\ndu *texte*\n</p>')
   330                           '<p>\ndu *texte*<br/>\n</p>')
   333         e.cw_attr_cache['title'] = 'zou'
   331         e.cw_attr_cache['title'] = 'zou'
   334         e.cw_attr_cache['content'] = '''\
   332         e.cw_attr_cache['content'] = '''\
   335 a title
   333 a title
   336 =======
   334 =======
   337 du :eid:`1:*ReST*`'''
   335 du :eid:`1:*ReST*`'''