From 1828eecc855fc86980b27796c28f7ddbbcdccfef Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sat, 11 Oct 2014 04:59:39 +0900 Subject: [PATCH] Stubout cinder.tenant_absolute_limits in cinder test To render dropdown actions to detail page, allowed() method in the volume table is called, so a method called in allowed() needs to be stubout. Change-Id: Ib65eee0fa2c8b6535e1e391579fcd1bdb0f83bc1 Closes-Bug: #1378907 --- .../dashboards/project/volumes/volumes/tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/project/volumes/volumes/tests.py b/openstack_dashboard/dashboards/project/volumes/volumes/tests.py index ec304a2aae..c8903ca3a8 100644 --- a/openstack_dashboard/dashboards/project/volumes/volumes/tests.py +++ b/openstack_dashboard/dashboards/project/volumes/volumes/tests.py @@ -955,7 +955,7 @@ class VolumeViewTests(test.TestCase): self.assertContains(res, expected_string, html=True, msg_prefix="The create button is not disabled") - @test.create_stubs({cinder: ('volume_get',), + @test.create_stubs({cinder: ('volume_get', 'tenant_absolute_limits'), api.nova: ('server_get',)}) def test_detail_view(self): volume = self.cinder_volumes.first() @@ -965,6 +965,8 @@ class VolumeViewTests(test.TestCase): cinder.volume_get(IsA(http.HttpRequest), volume.id).AndReturn(volume) api.nova.server_get(IsA(http.HttpRequest), server.id).AndReturn(server) + cinder.tenant_absolute_limits(IsA(http.HttpRequest))\ + .AndReturn(self.cinder_limits['absolute']) self.mox.ReplayAll()