diff --git a/muranodashboard/catalog/tabs.py b/muranodashboard/catalog/tabs.py index abf5bbc61..bc065fbc2 100644 --- a/muranodashboard/catalog/tabs.py +++ b/muranodashboard/catalog/tabs.py @@ -55,7 +55,7 @@ class AppRequirementsTab(tabs.Tab): def _get_requirements(self): forms = services.get_app_forms(self.request, {'app_id': self.app.id}) self.app.requirements = [] - for step in forms: + for step_name, step in forms: for key in step.base_fields: # Check for instance size requirements in the UI yaml file. if key == 'flavor': @@ -98,7 +98,7 @@ class AppLicenseAgreementTab(tabs.Tab): def _get_license(self): forms = services.get_app_forms(self.request, {'app_id': self.app.id}) self.app.license = '' - for step in forms: + for step_name, step in forms: for key in step.base_fields.keys(): # Check for a license in the UI yaml file. if key == 'license': diff --git a/muranodashboard/templates/catalog/_app_license.html b/muranodashboard/templates/catalog/_app_license.html index f40912257..4dcf71621 100644 --- a/muranodashboard/templates/catalog/_app_license.html +++ b/muranodashboard/templates/catalog/_app_license.html @@ -2,7 +2,7 @@ {% load url from future %} -
{% if application.license %} {{ application.license|linebreaksbr }} diff --git a/muranodashboard/tests/functional/sanity_check.py b/muranodashboard/tests/functional/sanity_check.py index 22712a98f..41422069a 100644 --- a/muranodashboard/tests/functional/sanity_check.py +++ b/muranodashboard/tests/functional/sanity_check.py @@ -545,7 +545,9 @@ class TestSuiteApplications(base.ApplicationTestCase): self.driver.find_element_by_xpath( "//div[@class='app-description']").text) self.driver.find_element_by_link_text('Requirements').click() + self.driver.find_element_by_class_name('app_requirements') self.driver.find_element_by_link_text('License').click() + self.driver.find_element_by_class_name('app_license') def test_check_topology_page(self): """Test checks that topology tab is available diff --git a/muranodashboard/tests/test_tabs.py b/muranodashboard/tests/test_tabs.py index 5d8337409..79cb0d295 100644 --- a/muranodashboard/tests/test_tabs.py +++ b/muranodashboard/tests/test_tabs.py @@ -34,7 +34,7 @@ class TestLicenseTab(helpers.APITestCase): description='Lorem ipsum dolor sit ' 'amet, consectetur adipiscing elit.') } - mock_services.get_app_forms.return_value = [m] + mock_services.get_app_forms.return_value = [('', m)] # Fake an application object, needed when instantiating tabs. app = mock.MagicMock() @@ -56,7 +56,7 @@ class TestLicenseTab(helpers.APITestCase): # Fake the services.get_app_forms() call. m = mock.MagicMock() m.base_fields = {} - mock_services.get_app_forms.return_value = [m] + mock_services.get_app_forms.return_value = [('', m)] # Fake an application object, needed when instantiating tabs. app = mock.MagicMock() @@ -87,7 +87,7 @@ class TestRequirementsTab(helpers.APITestCase): 'min_memory_mb': 2048 }) } - mock_services.get_app_forms.return_value = [m] + mock_services.get_app_forms.return_value = [('', m)] app = mock.MagicMock() app.id = 1 @@ -114,7 +114,7 @@ class TestRequirementsTab(helpers.APITestCase): m = mock.MagicMock() m.base_fields = {} - mock_services.get_app_forms.return_value = [m] + mock_services.get_app_forms.return_value = [('', m)] app = mock.MagicMock() app.id = 1