Added audit & strategy ObjectField for ActionPlan

In this changeset, I added the "audit" and the "strategy "ObjectField
which can either be loaded by setting the new "eager" parameter as True
or not loaded (as before) by setting it to False.
The advantage of introducing this eager parameter is that this way,
we can reduce to a minimum the overhead of DB queries whenever the
related object fields is not actually needed.

Change-Id: Ieca6fa438cbf2267f5ae2ea0d059b2953e65076b
Partially-Implements: blueprint watcher-versioned-objects
This commit is contained in:
Vincent Françoise
2016-10-03 17:43:50 +02:00
parent f9df54c555
commit 060c369838
8 changed files with 306 additions and 194 deletions

View File

@@ -28,8 +28,10 @@ from watcher.tests.objects import utils as obj_utils
class TestDefaultActionPlanHandler(base.DbTestCase):
def setUp(self):
super(TestDefaultActionPlanHandler, self).setUp()
self.action_plan = obj_utils.create_test_action_plan(
self.context)
obj_utils.create_test_goal(self.context)
obj_utils.create_test_strategy(self.context)
obj_utils.create_test_audit(self.context)
self.action_plan = obj_utils.create_test_action_plan(self.context)
def test_launch_action_plan(self):
command = default.DefaultActionPlanHandler(