diff options
author | Tzu-Mainn Chen <tzumainn@redhat.com> | 2013-10-07 15:56:23 -0400 |
---|---|---|
committer | Tzu-Mainn Chen <tzumainn@redhat.com> | 2013-10-07 15:57:22 -0400 |
commit | ba442dbcd45316f3dad06012bb8eb5859c6e3b98 (patch) | |
tree | 0d0fb98c086b884dd3c2b7f10f0aef99b0b34120 | |
parent | 385b07a47b6aa411420b1a2f838b6e2da3f10fa5 (diff) | |
download | tuskar-ui-ba442dbcd45316f3dad06012bb8eb5859c6e3b98.tar.gz |
Fix call to Flavor.get
The call to Flavor.get in the flavor detail page had
the arguments reversed.
This commit also updates the matching test so that such
an error will be caught in the future.
Change-Id: Ice018c07a60452cd778c22457c2cd491e266f72b
Closes-Bug: #1236562
-rw-r--r-- | tuskar_ui/infrastructure/resource_management/flavors/tests.py | 4 | ||||
-rw-r--r-- | tuskar_ui/infrastructure/resource_management/flavors/views.py | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/tuskar_ui/infrastructure/resource_management/flavors/tests.py b/tuskar_ui/infrastructure/resource_management/flavors/tests.py index a4958037..3c07c365 100644 --- a/tuskar_ui/infrastructure/resource_management/flavors/tests.py +++ b/tuskar_ui/infrastructure/resource_management/flavors/tests.py @@ -25,7 +25,7 @@ class FlavorsTests(test.BaseAdminViewTests): @test.create_stubs({tuskar.Flavor: ('get',), tuskar.ResourceClass: ('get',)}) def test_detail_flavor(self): - flavor = self.tuskar_flavors.first() + flavor = self.tuskar_flavors.list()[1] resource_class = self.tuskar_resource_classes.first() tuskar.ResourceClass.get(mox.IsA(http.HttpRequest), @@ -48,7 +48,7 @@ class FlavorsTests(test.BaseAdminViewTests): @test.create_stubs({tuskar.Flavor: ('get',)}) def test_detail_flavor_exception(self): - flavor = self.tuskar_flavors.first() + flavor = self.tuskar_flavors.list()[1] resource_class = self.tuskar_resource_classes.first() tuskar.Flavor.get(mox.IsA(http.HttpRequest), diff --git a/tuskar_ui/infrastructure/resource_management/flavors/views.py b/tuskar_ui/infrastructure/resource_management/flavors/views.py index 092cce6b..680e8955 100644 --- a/tuskar_ui/infrastructure/resource_management/flavors/views.py +++ b/tuskar_ui/infrastructure/resource_management/flavors/views.py @@ -38,9 +38,8 @@ class DetailView(horizon_tabs.TabView): try: flavor_id = self.kwargs['flavor_id'] resource_class_id = self.kwargs['resource_class_id'] - flavor = tuskar.Flavor.get(self.request, - flavor_id, - resource_class_id) + flavor = tuskar.Flavor.get( + self.request, resource_class_id, flavor_id) except Exception: redirect = urlresolvers.reverse( 'horizon:infrastructure:resource_management:index') |