def test_stack_user_project_id_create(self):
    self.stub_keystoneclient()
    self.stack = stack.Stack(self.ctx, 'user_project_init', self.tmpl)
    self.stack.store()
    self.assertIsNone(self.stack.stack_user_project_id)
    self.stack.create_stack_user_project_id()
    self.assertEqual('aprojectid', self.stack.stack_user_project_id)
    db_stack = stack_object.Stack.get_by_id(self.ctx, self.stack.id)
    self.assertEqual('aprojectid', db_stack.stack_user_project_id)
    self.stack.delete()
    self.assertEqual((stack.Stack.DELETE, stack.Stack.COMPLETE), self.stack.state)
def test_stack_user_project_id_create(self):
    self.stub_keystoneclient()
    self.stack = stack.Stack(self.ctx, 'user_project_init', self.tmpl)
    self.stack.store()
    self.assertIsNone(self.stack.stack_user_project_id)
    self.stack.create_stack_user_project_id()
    self.assertEqual('aprojectid', self.stack.stack_user_project_id)
    db_stack = stack_object.Stack.get_by_id(self.ctx, self.stack.id)
    self.assertEqual('aprojectid', db_stack.stack_user_project_id)
    self.stack.delete()
    self.assertEqual((stack.Stack.DELETE, stack.Stack.COMPLETE), self.stack.state)