def test_db_is_reset(self): con = DatabaseLayer.connect() cur = con.cursor() cur.execute("DELETE FROM Wikiname") self.failUnlessEqual(self.getWikinameCount(con), 0) con.commit() # Run the per-test code for the Database layer. DatabaseLayer.testTearDown() DatabaseLayer.testSetUp() # Wikiname table should have been restored. con = DatabaseLayer.connect() self.assertNotEqual(0, self.getWikinameCount(con))
def testLaunchpadDbAvailable(self): if not self.want_launchpad_database: self.assertEqual(None, DatabaseLayer._db_fixture) return con = DatabaseLayer.connect() cur = con.cursor() cur.execute("SELECT id FROM Person LIMIT 1") self.assertNotEqual(None, cur.fetchone())
def testConnect(self): DatabaseLayer.connect()