def test_get_by_id(self): """ Test we can get a hero by their ID """ crystal_maiden = Hero.get_by_id(self.CRYSTAL_MAIDEN['id']) self.assertIsNotNone(crystal_maiden) self.assertEqual(crystal_maiden.id, self.CRYSTAL_MAIDEN['id']) self.assertEqual(crystal_maiden.name, self.CRYSTAL_MAIDEN['name']) self.assertEqual(crystal_maiden.localized_name, self.CRYSTAL_MAIDEN['localized_name']) self.assertEqual(crystal_maiden.image, url_for('hero_image', hero_name=self.CRYSTAL_MAIDEN['image_name']))
def test_get_by_id(self): """ Test we can get a hero by their ID """ crystal_maiden = Hero.get_by_id(self.CRYSTAL_MAIDEN['id']) self.assertIsNotNone(crystal_maiden) self.assertEqual(crystal_maiden.id, self.CRYSTAL_MAIDEN['id']) self.assertEqual(crystal_maiden.token, self.CRYSTAL_MAIDEN['token']) self.assertEqual(crystal_maiden.name, self.CRYSTAL_MAIDEN['name']) self.assertEqual(crystal_maiden.localized_name, self.CRYSTAL_MAIDEN['localized_name']) self.assertEqual( crystal_maiden.image, url_for('hero_image', hero_name=self.CRYSTAL_MAIDEN['image_name']))
def hero(self): return Hero.get_by_id(self.hero_id)