def test_GetWithNoParams(self): r = self.testApp.get('/countries/') self.assertEqual(r.status, 200) countries = json.loads(r.body) self.assertListEqual(countries, Countries.find(lambda c: True))
def test_Countries(self): countries = Countries.find(lambda c: True) with_code = [country for country in countries if country['code']] self.assertTrue(len(with_code)/float(len(countries)) > 0.67)