335 def test_absolute_url_base_url(self): |
335 def test_absolute_url_base_url(self): |
336 cu = self.cnx2.cursor() |
336 cu = self.cnx2.cursor() |
337 ceid = cu.execute('INSERT Card X: X title "without wikiid to get eid based url"')[0][0] |
337 ceid = cu.execute('INSERT Card X: X title "without wikiid to get eid based url"')[0][0] |
338 self.cnx2.commit() |
338 self.cnx2.commit() |
339 lc = self.sexecute('Card X WHERE X title "without wikiid to get eid based url"').get_entity(0, 0) |
339 lc = self.sexecute('Card X WHERE X title "without wikiid to get eid based url"').get_entity(0, 0) |
340 self.assertEqual(lc.absolute_url(), 'http://extern.org/card/eid/%s' % ceid) |
340 self.assertEqual(lc.absolute_url(), 'http://extern.org/%s' % ceid) |
341 cu.execute('DELETE Card X WHERE X eid %(x)s', {'x':ceid}) |
341 cu.execute('DELETE Card X WHERE X eid %(x)s', {'x':ceid}) |
342 self.cnx2.commit() |
342 self.cnx2.commit() |
343 |
343 |
344 def test_absolute_url_no_base_url(self): |
344 def test_absolute_url_no_base_url(self): |
345 cu = self.cnx3.cursor() |
345 cu = self.cnx3.cursor() |
346 ceid = cu.execute('INSERT Card X: X title "without wikiid to get eid based url"')[0][0] |
346 ceid = cu.execute('INSERT Card X: X title "without wikiid to get eid based url"')[0][0] |
347 self.cnx3.commit() |
347 self.cnx3.commit() |
348 lc = self.sexecute('Card X WHERE X title "without wikiid to get eid based url"').get_entity(0, 0) |
348 lc = self.sexecute('Card X WHERE X title "without wikiid to get eid based url"').get_entity(0, 0) |
349 self.assertEqual(lc.absolute_url(), 'http://testing.fr/cubicweb/card/eid/%s' % lc.eid) |
349 self.assertEqual(lc.absolute_url(), 'http://testing.fr/cubicweb/%s' % lc.eid) |
350 cu.execute('DELETE Card X WHERE X eid %(x)s', {'x':ceid}) |
350 cu.execute('DELETE Card X WHERE X eid %(x)s', {'x':ceid}) |
351 self.cnx3.commit() |
351 self.cnx3.commit() |
352 |
352 |
353 def test_crossed_relation_noeid_needattr(self): |
353 def test_crossed_relation_noeid_needattr(self): |
354 """http://www.cubicweb.org/ticket/1382452""" |
354 """http://www.cubicweb.org/ticket/1382452""" |