def test_get_unconsented(self): obs = db.get_unconsented() # we don't know the actual number independent of DB version, but we can # assume that we have a certain amount of those barcodes. self.assertTrue(len(obs) >= 100) # we cannot know which barcodes are unconsented without executing the # db function itself. Thus, for unit tests, we should only check data # types. self.assertTrue(obs[0][0].isdigit()) self.assertTrue(isinstance(obs[0][1], datetime.date)) self.assertTrue(isinstance(obs[0][2], str))
def test_get_unconsented(self): obs = db.get_unconsented() self.assertEqual(len(obs), 433) exp = ["000001000", datetime.date(2015, 4, 10), "REMOVED"] self.assertEqual(obs[0], exp)
def test_get_unconsented(self): obs = db.get_unconsented() self.assertEqual(len(obs), 433) exp = ['000001000', datetime.date(2015, 4, 10), 'REMOVED'] self.assertEqual(obs[0], exp)