26 f1 = req.create_entity('Folder', name=u'par&ent') |
26 f1 = req.create_entity('Folder', name=u'par&ent') |
27 f2 = req.create_entity('Folder', name=u'chi&ld') |
27 f2 = req.create_entity('Folder', name=u'chi&ld') |
28 self.execute('SET F2 filed_under F1 WHERE F1 eid %(f1)s, F2 eid %(f2)s', |
28 self.execute('SET F2 filed_under F1 WHERE F1 eid %(f1)s, F2 eid %(f2)s', |
29 {'f1' : f1.eid, 'f2' : f2.eid}) |
29 {'f1' : f1.eid, 'f2' : f2.eid}) |
30 self.commit() |
30 self.commit() |
31 self.assertEquals(f2.view('breadcrumbs'), |
31 self.assertEqual(f2.view('breadcrumbs'), |
32 '<a href="http://testing.fr/cubicweb/folder/%s" title="">chi&ld</a>' % f2.eid) |
32 '<a href="http://testing.fr/cubicweb/folder/%s" title="">chi&ld</a>' % f2.eid) |
33 childrset = f2.as_rset() |
33 childrset = f2.as_rset() |
34 ibc = self.vreg['components'].select('breadcrumbs', self.request(), rset=childrset) |
34 ibc = self.vreg['components'].select('breadcrumbs', self.request(), rset=childrset) |
35 self.assertEquals(ibc.render(), |
35 self.assertEqual(ibc.render(), |
36 """<span id="breadcrumbs" class="pathbar"> > <a href="http://testing.fr/cubicweb/Folder">folder_plural</a> > <a href="http://testing.fr/cubicweb/folder/%s" title="">par&ent</a> >  |
36 """<span id="breadcrumbs" class="pathbar"> > <a href="http://testing.fr/cubicweb/Folder">folder_plural</a> > <a href="http://testing.fr/cubicweb/folder/%s" title="">par&ent</a> >  |
37 <a href="http://testing.fr/cubicweb/folder/%s" title="">chi&ld</a></span>""" % (f1.eid, f2.eid)) |
37 <a href="http://testing.fr/cubicweb/folder/%s" title="">chi&ld</a></span>""" % (f1.eid, f2.eid)) |
38 |
38 |
39 if __name__ == '__main__': |
39 if __name__ == '__main__': |
40 from logilab.common.testlib import unittest_main |
40 from logilab.common.testlib import unittest_main |