'Basic flavor creation lifecycle testing.
- Creating a flavor
- Ensure it\'s in the database
- Ensure it\'s in the listing
- Delete it
- Ensure it\'s hidden in the database'

def test_flavor_manage_func(self):

    ctx = context.get_admin_context()
    flav1 = {'flavor': rand_flavor()}
    self.api.api_post('flavors', flav1)
    flav1db = objects.Flavor.get_by_flavor_id(ctx, flav1['flavor']['id'])
    self.assertFlavorDbEqual(flav1['flavor'], flav1db)
    resp = self.api.api_get('flavors')
    self.assertFlavorInList(flav1['flavor'], resp.body)
    self.api.api_delete(('flavors/%s' % flav1['flavor']['id']))
    self.assertRaises(ex.FlavorNotFound, objects.Flavor.get_by_flavor_id, ctx, flav1['flavor']['id'])
    resp = self.api.api_delete(('flavors/%s' % flav1['flavor']['id']), check_response_status=False)
    self.assertEqual(404, resp.status)
