74 #del TwoSourcesTC.config.vreg |
74 #del TwoSourcesTC.config.vreg |
75 #del TwoSourcesTC.config |
75 #del TwoSourcesTC.config |
76 TestServerConfiguration.no_sqlite_wrap = False |
76 TestServerConfiguration.no_sqlite_wrap = False |
77 |
77 |
78 class TwoSourcesTC(CubicWebTC): |
78 class TwoSourcesTC(CubicWebTC): |
79 |
79 """Main repo -> extern-multi -> extern |
|
80 \-------------/ |
|
81 """ |
80 @classmethod |
82 @classmethod |
81 def _refresh_repo(cls): |
83 def _refresh_repo(cls): |
82 super(TwoSourcesTC, cls)._refresh_repo() |
84 super(TwoSourcesTC, cls)._refresh_repo() |
83 cnx2.rollback() |
85 cnx2.rollback() |
84 refresh_repo(repo2) |
86 refresh_repo(repo2) |
321 lc = self.sexecute('Card X WHERE X title "without wikiid to get eid based url"').get_entity(0, 0) |
323 lc = self.sexecute('Card X WHERE X title "without wikiid to get eid based url"').get_entity(0, 0) |
322 self.assertEqual(lc.absolute_url(), 'http://testing.fr/cubicweb/card/eid/%s' % lc.eid) |
324 self.assertEqual(lc.absolute_url(), 'http://testing.fr/cubicweb/card/eid/%s' % lc.eid) |
323 cu.execute('DELETE Card X WHERE X eid %(x)s', {'x':ceid}) |
325 cu.execute('DELETE Card X WHERE X eid %(x)s', {'x':ceid}) |
324 cnx3.commit() |
326 cnx3.commit() |
325 |
327 |
|
328 def test_crossed_relation_noeid_needattr(self): |
|
329 """http://www.cubicweb.org/ticket/1382452""" |
|
330 aff1 = self.sexecute('INSERT Affaire X: X ref "AFFREF"')[0][0] |
|
331 # link within extern source |
|
332 ec1 = self.sexecute('Card X WHERE X wikiid "zzz"')[0][0] |
|
333 self.sexecute('SET A documented_by C WHERE E eid %(a)s, C eid %(c)s', |
|
334 {'a': aff1, 'c': ec1}) |
|
335 # link from system to extern source |
|
336 self.sexecute('SET A documented_by C WHERE E eid %(a)s, C eid %(c)s', |
|
337 {'a': aff1, 'c': self.ic2}) |
|
338 rset = self.sexecute('DISTINCT Any DEP WHERE P ref "AFFREF", P documented_by DEP, DEP wikiid LIKE "z%"') |
|
339 self.assertEqual(sorted(rset.rows), [[ec1], [self.ic2]]) |
|
340 |
326 def test_nonregr1(self): |
341 def test_nonregr1(self): |
327 ueid = self.session.user.eid |
342 ueid = self.session.user.eid |
328 affaire = self.sexecute('Affaire X WHERE X ref "AFFREF"').get_entity(0, 0) |
343 affaire = self.sexecute('Affaire X WHERE X ref "AFFREF"').get_entity(0, 0) |
329 self.sexecute('Any U WHERE U in_group G, (G name IN ("managers", "logilab") OR (X require_permission P?, P name "bla", P require_group G)), X eid %(x)s, U eid %(u)s', |
344 self.sexecute('Any U WHERE U in_group G, (G name IN ("managers", "logilab") OR (X require_permission P?, P name "bla", P require_group G)), X eid %(x)s, U eid %(u)s', |
330 {'x': affaire.eid, 'u': ueid}) |
345 {'x': affaire.eid, 'u': ueid}) |