'Test to ensure skip checking policy rule create:attach_network,
when networks is \'none\' which means no network will be allocated.'

@mock.patch.object(context.RequestContext, 'can')
def test_create_server_networks_none_skip_policy(self, context_can):

    with test.nested(mock.patch('nova.objects.service.get_minimum_version_all_cells', return_value=14), mock.patch.object(nova.compute.flavors, 'get_flavor_by_flavor_id', return_value=objects.Flavor()), mock.patch.object(compute_api.API, 'create', return_value=([{'uuid': 'f9bccadf-5ab1-4a56-9156-c00c178fe5f5'}], 1))):
        network_policy = (server_policies.SERVERS % 'create:attach_network')
        self._create_server('none')
        call_list = [c for c in context_can.call_args_list if (c[0][0] == network_policy)]
        self.assertEqual(0, len(call_list))
