232 config = ApptestConfiguration(appid, sourcefile=sourcefile) |
232 config = ApptestConfiguration(appid, sourcefile=sourcefile) |
233 if verbose: |
233 if verbose: |
234 print "init test database ..." |
234 print "init test database ..." |
235 source = config.sources()['system'] |
235 source = config.sources()['system'] |
236 self.vreg = CubicWebRegistry(config) |
236 self.vreg = CubicWebRegistry(config) |
237 repo, self.cnx = init_test_database(driver=source['db-driver'], |
237 self.cnx = init_test_database(driver=source['db-driver'], |
238 vreg=self.vreg) |
238 vreg=self.vreg)[1] |
239 if verbose: |
239 if verbose: |
240 print "init done" |
240 print "init done" |
241 self.app = CubicWebPublisher(config, vreg=self.vreg) |
241 self.app = CubicWebPublisher(config, vreg=self.vreg) |
242 self.verbose = verbose |
242 self.verbose = verbose |
243 # this is done when the publisher is opening a connection |
243 # this is done when the publisher is opening a connection |
244 self.cnx.vreg = self.vreg |
244 self.cnx.vreg = self.vreg |
245 login = source['db-user'] |
|
246 |
245 |
247 def setup(self, config=None): |
246 def setup(self, config=None): |
248 """config is passed by TestSuite but is ignored in this environment""" |
247 """config is passed by TestSuite but is ignored in this environment""" |
249 cursor = self.cnx.cursor() |
248 cursor = self.cnx.cursor() |
250 self.last_eid = cursor.execute('Any X WHERE X creation_date D ORDERBY D DESC LIMIT 1').rows[0][0] |
249 self.last_eid = cursor.execute('Any X WHERE X creation_date D ORDERBY D DESC LIMIT 1').rows[0][0] |