'Test to verify inherited rule is working. The rule of the
deprecated action is not set to the default, so the deprecated
action is being enforced'

@mock.patch.object(policy.LOG, 'warning')
def test_create_policy_rbac_inherit_default(self, mock_warning):

    default_flavor_policy = 'os_compute_api:os-flavor-manage'
    create_flavor_policy = 'os_compute_api:os-flavor-manage:create'
    rules = {default_flavor_policy: 'is_admin:True', create_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}}
    self.controller._create(self.adm_req, body=body)
    exc = self.assertRaises(exception.PolicyNotAuthorized, self.controller._create, self.req, body=body)
    self.assertEqual(("Policy    doesn't    allow    %s    to    be    performed." % default_flavor_policy), exc.format_message())
    mock_warning.assert_called_with("Start    using    the    new    action    '{0}'.    The    existing    action    '{1}'    is    being    deprecated    and    will    be    removed    in    future    release.".format(create_flavor_policy, default_flavor_policy))
