def test_condition_getter_with_application_name(self, mock_pkg_api):
        mock_pkg_api.get_app_ui.return_value = {
            'foo': 'bar',
            'application': self.application
        }

        service = services.Service(cleaned_data={},
                                   version=semantic_version.Version('2.1.9'),
                                   fqn='io.murano.Test',
                                   application=self.application)
        form = service_forms.ServiceConfigurationForm()
        form.service = service
        form.base_fields = {'application_name': 'foo_app_name'}
        wizard = catalog_views.Wizard()
        wizard.kwargs = {'drop_wm_form': False}

        wizard.form_list = collections.OrderedDict({'123': form})

        kwargs = {'app_id': '123'}
        result = services.condition_getter(self.request, kwargs)
        self.assertIn('Step 1', result)
        self.assertIsNotNone(result['Step 1'])

        result = result['Step 1'](wizard)
        self.assertTrue(result)
        self.assertNotIn('application_name', form.base_fields)
    def test_condition_getter_with_form_hidden(self, mock_pkg_api):
        mock_pkg_api.get_app_ui.return_value = {
            'foo': 'bar',
            'application': self.application
        }

        service = services.Service(cleaned_data={},
                                   version=semantic_version.Version('2.1.9'),
                                   fqn='io.murano.Test',
                                   application=self.application)
        form = service_forms.ServiceConfigurationForm()
        form.service = service
        wizard = catalog_views.Wizard()
        wizard.kwargs = {'drop_wm_form': True}

        wizard.form_list = collections.OrderedDict({
            '123': form
        })

        kwargs = {'app_id': '123'}
        result = services.condition_getter(self.request, kwargs)
        self.assertIn('Step 1', result)
        self.assertIsNotNone(result['Step 1'])

        result = result['Step 1'](wizard)
        self.assertFalse(result)