'Test stack loading with disabled parameter value validation.'

def test_stack_load_no_param_value_validation(self):

    tmpl = template_format.parse('\n                                heat_template_version:    2013-05-23\n                                parameters:\n                                                flavor:\n                                                                type:    string\n                                                                description:    A    flavor.\n                                                                constraints:\n                                                                                -    custom_constraint:    nova.flavor\n                                resources:\n                                                a_resource:\n                                                                type:    GenericResourceType\n                                ')
    fc = fakes.FakeClient()
    self.m.StubOutWithMock(nova.NovaClientPlugin, '_create')
    nova.NovaClientPlugin._create().AndReturn(fc)
    fc.flavors = self.m.CreateMockAnything()
    flavor = collections.namedtuple('Flavor', ['id', 'name'])
    flavor.id = '1234'
    flavor.name = 'dummy'
    fc.flavors.get('1234').AndReturn(flavor)
    self.m.ReplayAll()
    test_env = environment.Environment({'flavor': '1234'})
    self.stack = stack.Stack(self.ctx, 'stack_with_custom_constraint', template.Template(tmpl, env=test_env))
    self.stack.validate()
    self.stack.store()
    self.stack.create()
    stack_id = self.stack.id
    self.m.VerifyAll()
    self.assertEqual((stack.Stack.CREATE, stack.Stack.COMPLETE), self.stack.state)
    loaded_stack = stack.Stack.load(self.ctx, stack_id=self.stack.id)
    self.assertEqual(stack_id, loaded_stack.parameters['OS::stack_id'])
    self.m.VerifyAll()
