43 from cubicweb.dbapi import Connection |
43 from cubicweb.dbapi import Connection |
44 |
44 |
45 PyroRQLSource_get_connection = PyroRQLSource.get_connection |
45 PyroRQLSource_get_connection = PyroRQLSource.get_connection |
46 Connection_close = Connection.close |
46 Connection_close = Connection.close |
47 |
47 |
48 <<<<<<< /home/syt/src/fcubicweb/cubicweb/server/test/unittest_multisources.py |
|
49 def add_extern_mapping(source): |
48 def add_extern_mapping(source): |
50 execute = source._cw.execute |
49 execute = source._cw.execute |
51 for etype in ('Card', 'Affaire', 'State'): |
50 for etype in ('Card', 'Affaire', 'State'): |
52 assert execute('SET S cw_support ET WHERE ET name %(etype)s, ET is CWEType, S eid %(s)s', |
51 assert execute('SET S cw_support ET WHERE ET name %(etype)s, ET is CWEType, S eid %(s)s', |
53 {'etype': etype, 's': source.eid}) |
52 {'etype': etype, 's': source.eid}) |
54 for rtype in ('in_state', 'documented_by', 'multisource_inlined_rel'): |
53 for rtype in ('in_state', 'documented_by', 'multisource_inlined_rel'): |
55 assert execute('SET S cw_support RT WHERE RT name %(rtype)s, RT is CWRType, S eid %(s)s', |
54 assert execute('SET S cw_support RT WHERE RT name %(rtype)s, RT is CWRType, S eid %(s)s', |
56 {'rtype': rtype, 's': source.eid}) |
55 {'rtype': rtype, 's': source.eid}) |
57 |
56 |
58 |
57 |
59 def setup_module(*args): |
|
60 ======= |
|
61 def setUpModule(*args): |
58 def setUpModule(*args): |
62 >>>>>>> /tmp/unittest_multisources.py~other.zhOXgM |
|
63 global repo2, cnx2, repo3, cnx3 |
59 global repo2, cnx2, repo3, cnx3 |
64 cfg1 = ExternalSource1Configuration('data', apphome=TwoSourcesTC.datadir) |
60 cfg1 = ExternalSource1Configuration('data', apphome=TwoSourcesTC.datadir) |
65 repo2, cnx2 = init_test_database(config=cfg1) |
61 repo2, cnx2 = init_test_database(config=cfg1) |
66 cfg2 = ExternalSource2Configuration('data', apphome=TwoSourcesTC.datadir) |
62 cfg2 = ExternalSource2Configuration('data', apphome=TwoSourcesTC.datadir) |
67 repo3, cnx3 = init_test_database(config=cfg2) |
63 repo3, cnx3 = init_test_database(config=cfg2) |