'Test to verify the correct action is being enforced. When the
rule configured for the deprecated action is the same as the
default, the new action should be enforced.'

def test_delete_policy_rbac_change_to_default_action_rule(self):

    default_flavor_policy = 'os_compute_api:os-flavor-manage'
    create_flavor_policy = 'os_compute_api:os-flavor-manage:create'
    delete_flavor_policy = 'os_compute_api:os-flavor-manage:delete'
    rules = {default_flavor_policy: 'rule:admin_api', create_flavor_policy: 'is_admin:True', delete_flavor_policy: ('rule:%s' % default_flavor_policy)}
    self.policy.set_rules(rules)
    body = {'flavor': {'name': 'azAZ09.    -_', 'ram': 512, 'vcpus': 2, 'disk': 1, 'OS-FLV-EXT-DATA:ephemeral': 1, 'id': six.text_type('1234'), 'swap': 512, 'rxtx_factor': 1, 'os-flavor-access:is_public': True}}
    flavor = self.controller._create(self.adm_req, body=body)
    exc = self.assertRaises(exception.PolicyNotAuthorized, self.controller._delete, self.req, flavor['flavor']['id'])
    self.assertEqual(("Policy    doesn't    allow    %s    to    be    performed." % delete_flavor_policy), exc.format_message())
