def tearDown(self): for testUser in self.testUsers: purge_database_json.purgeData('localhost', testUser) logging.debug("Number of sections after purge is %d" % self.SectionsColl.find().count()) self.ModesColl.remove() self.assertEquals(self.ModesColl.find().count(), 0)
def testLoadPurgeDatabase(self): Testdb = MongoClient(self.serverName).Test_database Sections=Testdb.Test_Sections purge_database_json.purgeData('localhost', self.testUser) self.assertEqual(Sections.find({'user_id' : self.testUser}).count(), 0) load_database_json.loadData(self.serverName, 'CFC_WebApp/tests/data/testLoadFile') self.assertEqual(Sections.find({'user_id': self.testUser}).count(), 3) purge_database_json.purgeData('localhost', self.testUser) self.assertEqual(Sections.find({'user_id' : self.testUser}).count(), 0)
def testLoadPurgeDatabase(self): Testdb = MongoClient(self.serverName).Test_database Sections = Testdb.Test_Sections purge_database_json.purgeData('localhost', self.testUser) self.assertEqual(Sections.find({'user_id': self.testUser}).count(), 0) load_database_json.loadData(self.serverName, 'tests/data/testLoadFile') self.assertEqual(Sections.find({'user_id': self.testUser}).count(), 3) purge_database_json.purgeData('localhost', self.testUser) self.assertEqual(Sections.find({'user_id': self.testUser}).count(), 0)
def tearDown(self): for testUser in self.testUsers: purge_database_json.purgeData('localhost', testUser) self.Profiles.remove() self.assertEquals(self.Profiles.find().count(), 0)