Merge "Refactored the templates code"
This commit is contained in:
commit
477b73a187
@ -1,9 +1,9 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "Specify VIP" %}{% endblock %}
|
{% block title %}{% trans workflow.name %}{% endblock %}
|
||||||
|
|
||||||
{% block page_header %}
|
{% block page_header %}
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Specify VIP") %}
|
{% include "horizon/common/_page_header.html" with title=workflow.name %}
|
||||||
{% endblock page_header %}
|
{% endblock page_header %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
@ -54,7 +54,7 @@ class WorkflowView(generic.TemplateView):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
workflow_class = None
|
workflow_class = None
|
||||||
template_name = None
|
template_name = 'horizon/common/_workflow_base.html'
|
||||||
context_object_name = "workflow"
|
context_object_name = "workflow"
|
||||||
ajax_template_name = 'horizon/common/_workflow.html'
|
ajax_template_name = 'horizon/common/_workflow.html'
|
||||||
step_errors = {}
|
step_errors = {}
|
||||||
|
@ -34,9 +34,7 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class CreateView(project_views.CreateView):
|
class CreateView(project_views.CreateView):
|
||||||
workflow_class = CreateSubnet
|
workflow_class = CreateSubnet
|
||||||
template_name = 'admin/networks/subnets/create.html'
|
|
||||||
|
|
||||||
|
|
||||||
class UpdateView(project_views.UpdateView):
|
class UpdateView(project_views.UpdateView):
|
||||||
workflow_class = UpdateSubnet
|
workflow_class = UpdateSubnet
|
||||||
template_name = 'admin/networks/subnets/update.html'
|
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Create Subnet" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Create Subnet") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include "horizon/common/_workflow.html" %}
|
|
||||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Update Subnet" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Update Subnet") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include "horizon/common/_workflow.html" %}
|
|
||||||
{% endblock %}
|
|
@ -23,6 +23,7 @@ from openstack_dashboard import api
|
|||||||
from openstack_dashboard.test import helpers as test
|
from openstack_dashboard.test import helpers as test
|
||||||
from openstack_dashboard.dashboards.project.networks.tests \
|
from openstack_dashboard.dashboards.project.networks.tests \
|
||||||
import form_data_subnet
|
import form_data_subnet
|
||||||
|
from horizon.workflows.views import WorkflowView
|
||||||
|
|
||||||
|
|
||||||
INDEX_URL = reverse('horizon:admin:networks:index')
|
INDEX_URL = reverse('horizon:admin:networks:index')
|
||||||
@ -381,7 +382,7 @@ class NetworkSubnetTests(test.BaseAdminViewTests):
|
|||||||
args=[network.id])
|
args=[network.id])
|
||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
|
|
||||||
self.assertTemplateUsed(res, 'admin/networks/subnets/create.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
|
|
||||||
@test.create_stubs({api.quantum: ('network_get',
|
@test.create_stubs({api.quantum: ('network_get',
|
||||||
'subnet_create',)})
|
'subnet_create',)})
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Create Project" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Create Project") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
|
||||||
{% endblock %}
|
|
@ -1,12 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Edit Project" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Edit Project") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
|
||||||
{% endblock %}
|
|
@ -27,6 +27,7 @@ from openstack_dashboard import api
|
|||||||
from openstack_dashboard.test import helpers as test
|
from openstack_dashboard.test import helpers as test
|
||||||
from openstack_dashboard.usage import quotas
|
from openstack_dashboard.usage import quotas
|
||||||
from .workflows import CreateProject, UpdateProject
|
from .workflows import CreateProject, UpdateProject
|
||||||
|
from horizon.workflows.views import WorkflowView
|
||||||
|
|
||||||
INDEX_URL = reverse('horizon:admin:projects:index')
|
INDEX_URL = reverse('horizon:admin:projects:index')
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
|
|||||||
url = reverse('horizon:admin:projects:create')
|
url = reverse('horizon:admin:projects:create')
|
||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
|
|
||||||
self.assertTemplateUsed(res, 'admin/projects/create.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
self.assertEqual(res.context['workflow'].name, CreateProject.name)
|
self.assertEqual(res.context['workflow'].name, CreateProject.name)
|
||||||
@ -194,7 +195,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
|
|||||||
url = reverse('horizon:admin:projects:create')
|
url = reverse('horizon:admin:projects:create')
|
||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
|
|
||||||
self.assertTemplateUsed(res, 'admin/projects/create.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
self.assertContains(res, "Unable to retrieve default quota values")
|
self.assertContains(res, "Unable to retrieve default quota values")
|
||||||
|
|
||||||
@test.create_stubs({api.keystone: ('tenant_create',
|
@test.create_stubs({api.keystone: ('tenant_create',
|
||||||
@ -443,7 +444,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
|
|||||||
args=[self.tenant.id])
|
args=[self.tenant.id])
|
||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
|
|
||||||
self.assertTemplateUsed(res, 'admin/projects/update.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
self.assertEqual(res.context['workflow'].name, UpdateProject.name)
|
self.assertEqual(res.context['workflow'].name, UpdateProject.name)
|
||||||
|
@ -128,7 +128,6 @@ class TenantUsageView(usage.UsageView):
|
|||||||
|
|
||||||
class CreateProjectView(workflows.WorkflowView):
|
class CreateProjectView(workflows.WorkflowView):
|
||||||
workflow_class = CreateProject
|
workflow_class = CreateProject
|
||||||
template_name = "admin/projects/create.html"
|
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
initial = super(CreateProjectView, self).get_initial()
|
initial = super(CreateProjectView, self).get_initial()
|
||||||
@ -148,7 +147,6 @@ class CreateProjectView(workflows.WorkflowView):
|
|||||||
|
|
||||||
class UpdateProjectView(workflows.WorkflowView):
|
class UpdateProjectView(workflows.WorkflowView):
|
||||||
workflow_class = UpdateProject
|
workflow_class = UpdateProject
|
||||||
template_name = "admin/projects/update.html"
|
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
initial = super(UpdateProjectView, self).get_initial()
|
initial = super(UpdateProjectView, self).get_initial()
|
||||||
|
@ -30,6 +30,7 @@ from openstack_dashboard import api
|
|||||||
from openstack_dashboard.test import helpers as test
|
from openstack_dashboard.test import helpers as test
|
||||||
|
|
||||||
from .utils import get_int_or_uuid
|
from .utils import get_int_or_uuid
|
||||||
|
from horizon.workflows.views import WorkflowView
|
||||||
|
|
||||||
|
|
||||||
INDEX_URL = reverse('horizon:project:access_and_security:index')
|
INDEX_URL = reverse('horizon:project:access_and_security:index')
|
||||||
@ -48,8 +49,7 @@ class FloatingIpViewTests(test.TestCase):
|
|||||||
|
|
||||||
url = reverse('%s:associate' % NAMESPACE)
|
url = reverse('%s:associate' % NAMESPACE)
|
||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
self.assertTemplateUsed(res,
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
'project/access_and_security/floating_ips/associate.html')
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
choices = dict(workflow.steps[0].action.fields['ip_id'].choices)
|
choices = dict(workflow.steps[0].action.fields['ip_id'].choices)
|
||||||
# Verify that our "associated" floating IP isn't in the choices list.
|
# Verify that our "associated" floating IP isn't in the choices list.
|
||||||
|
@ -38,7 +38,6 @@ from .workflows import IPAssociationWorkflow
|
|||||||
|
|
||||||
class AssociateView(workflows.WorkflowView):
|
class AssociateView(workflows.WorkflowView):
|
||||||
workflow_class = IPAssociationWorkflow
|
workflow_class = IPAssociationWorkflow
|
||||||
template_name = "project/access_and_security/floating_ips/associate.html"
|
|
||||||
|
|
||||||
|
|
||||||
class AllocateView(forms.ModalFormView):
|
class AllocateView(forms.ModalFormView):
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Associate Floating IP" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Associate Floating IP") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
|
||||||
{% endblock %}
|
|
@ -27,6 +27,7 @@ from mox import IsA
|
|||||||
|
|
||||||
from openstack_dashboard import api
|
from openstack_dashboard import api
|
||||||
from openstack_dashboard.test import helpers as test
|
from openstack_dashboard.test import helpers as test
|
||||||
|
from horizon.workflows.views import WorkflowView
|
||||||
|
|
||||||
|
|
||||||
class AccessAndSecurityTests(test.TestCase):
|
class AccessAndSecurityTests(test.TestCase):
|
||||||
@ -86,8 +87,7 @@ class AccessAndSecurityTests(test.TestCase):
|
|||||||
|
|
||||||
res = self.client.get(reverse("horizon:project:access_and_security:"
|
res = self.client.get(reverse("horizon:project:access_and_security:"
|
||||||
"floating_ips:associate"))
|
"floating_ips:associate"))
|
||||||
self.assertTemplateUsed(res,
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
'project/access_and_security/floating_ips/associate.html')
|
|
||||||
|
|
||||||
self.assertContains(res,
|
self.assertContains(res,
|
||||||
'<option value="1">server_1 (1)</option>')
|
'<option value="1">server_1 (1)</option>')
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Launch Instance" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Launch Instance") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
|
||||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Edit Instance" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Edit Instance") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
|
||||||
{% endblock %}
|
|
@ -34,6 +34,7 @@ from openstack_dashboard.usage import quotas
|
|||||||
from .tables import LaunchLink
|
from .tables import LaunchLink
|
||||||
from .tabs import InstanceDetailTabs
|
from .tabs import InstanceDetailTabs
|
||||||
from .workflows import LaunchInstance
|
from .workflows import LaunchInstance
|
||||||
|
from horizon.workflows.views import WorkflowView
|
||||||
|
|
||||||
|
|
||||||
INDEX_URL = reverse('horizon:project:instances:index')
|
INDEX_URL = reverse('horizon:project:instances:index')
|
||||||
@ -660,7 +661,7 @@ class InstanceTests(test.TestCase):
|
|||||||
url = reverse('horizon:project:instances:update', args=[server.id])
|
url = reverse('horizon:project:instances:update', args=[server.id])
|
||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
|
|
||||||
self.assertTemplateUsed(res, 'project/instances/update.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
|
|
||||||
@test.create_stubs(instance_update_get_stubs)
|
@test.create_stubs(instance_update_get_stubs)
|
||||||
def test_instance_update_get_server_get_exception(self):
|
def test_instance_update_get_server_get_exception(self):
|
||||||
@ -844,8 +845,7 @@ class InstanceTests(test.TestCase):
|
|||||||
res = self.client.get("%s?%s" % (url, params))
|
res = self.client.get("%s?%s" % (url, params))
|
||||||
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
self.assertTemplateUsed(res,
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
'project/instances/launch.html')
|
|
||||||
self.assertEqual(res.context['workflow'].name, LaunchInstance.name)
|
self.assertEqual(res.context['workflow'].name, LaunchInstance.name)
|
||||||
step = workflow.get_step("setinstancedetailsaction")
|
step = workflow.get_step("setinstancedetailsaction")
|
||||||
self.assertEqual(step.action.initial['image_id'], image.id)
|
self.assertEqual(step.action.initial['image_id'], image.id)
|
||||||
@ -1005,8 +1005,7 @@ class InstanceTests(test.TestCase):
|
|||||||
self.assertFormErrors(res, 1, 'There are no image sources available; '
|
self.assertFormErrors(res, 1, 'There are no image sources available; '
|
||||||
'you must first create an image before '
|
'you must first create an image before '
|
||||||
'attempting to launch an instance.')
|
'attempting to launch an instance.')
|
||||||
self.assertTemplateUsed(res,
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
'project/instances/launch.html')
|
|
||||||
|
|
||||||
@test.create_stubs({api.glance: ('image_list_detailed',),
|
@test.create_stubs({api.glance: ('image_list_detailed',),
|
||||||
api.quantum: ('network_list',),
|
api.quantum: ('network_list',),
|
||||||
@ -1052,8 +1051,7 @@ class InstanceTests(test.TestCase):
|
|||||||
url = reverse('horizon:project:instances:launch')
|
url = reverse('horizon:project:instances:launch')
|
||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
|
|
||||||
self.assertTemplateUsed(res,
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
'project/instances/launch.html')
|
|
||||||
|
|
||||||
@test.create_stubs({api.glance: ('image_list_detailed',),
|
@test.create_stubs({api.glance: ('image_list_detailed',),
|
||||||
api.quantum: ('network_list',),
|
api.quantum: ('network_list',),
|
||||||
|
@ -94,7 +94,6 @@ class IndexView(tables.DataTableView):
|
|||||||
|
|
||||||
class LaunchInstanceView(workflows.WorkflowView):
|
class LaunchInstanceView(workflows.WorkflowView):
|
||||||
workflow_class = LaunchInstance
|
workflow_class = LaunchInstance
|
||||||
template_name = "project/instances/launch.html"
|
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
initial = super(LaunchInstanceView, self).get_initial()
|
initial = super(LaunchInstanceView, self).get_initial()
|
||||||
@ -145,7 +144,6 @@ def spice(request, instance_id):
|
|||||||
|
|
||||||
class UpdateView(workflows.WorkflowView):
|
class UpdateView(workflows.WorkflowView):
|
||||||
workflow_class = UpdateInstance
|
workflow_class = UpdateInstance
|
||||||
template_name = 'project/instances/update.html'
|
|
||||||
success_url = reverse_lazy("horizon:project:instances:index")
|
success_url = reverse_lazy("horizon:project:instances:index")
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Add New Member" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Add New Member") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
|
||||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Add New Monitor" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Add New Monitor") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
|
||||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Add New Pool" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Add New Pool") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
|
||||||
{% endblock %}
|
|
@ -12,6 +12,7 @@ from openstack_dashboard.api.lbaas import Pool, Vip, Member, PoolMonitor
|
|||||||
|
|
||||||
from .tabs import LoadBalancerTabs, MembersTab, PoolsTab, MonitorsTab
|
from .tabs import LoadBalancerTabs, MembersTab, PoolsTab, MonitorsTab
|
||||||
from .workflows import AddPool, AddMember, AddMonitor, AddVip
|
from .workflows import AddPool, AddMember, AddMonitor, AddVip
|
||||||
|
from horizon.workflows.views import WorkflowView
|
||||||
|
|
||||||
|
|
||||||
class LoadBalancerTests(test.TestCase):
|
class LoadBalancerTests(test.TestCase):
|
||||||
@ -220,7 +221,7 @@ class LoadBalancerTests(test.TestCase):
|
|||||||
res = self.client.get(reverse(self.ADDPOOL_PATH))
|
res = self.client.get(reverse(self.ADDPOOL_PATH))
|
||||||
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
self.assertTemplateUsed(res, 'project/loadbalancers/addpool.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
self.assertEqual(workflow.name, AddPool.name)
|
self.assertEqual(workflow.name, AddPool.name)
|
||||||
|
|
||||||
expected_objs = ['<AddPoolStep: addpoolaction>', ]
|
expected_objs = ['<AddPoolStep: addpoolaction>', ]
|
||||||
@ -326,7 +327,7 @@ class LoadBalancerTests(test.TestCase):
|
|||||||
res = self.client.get(reverse(self.ADDVIP_PATH, args=(pool.id,)))
|
res = self.client.get(reverse(self.ADDVIP_PATH, args=(pool.id,)))
|
||||||
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
self.assertTemplateUsed(res, 'project/loadbalancers/addvip.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
self.assertEqual(workflow.name, AddVip.name)
|
self.assertEqual(workflow.name, AddVip.name)
|
||||||
|
|
||||||
expected_objs = ['<AddVipStep: addvipaction>', ]
|
expected_objs = ['<AddVipStep: addvipaction>', ]
|
||||||
@ -422,7 +423,7 @@ class LoadBalancerTests(test.TestCase):
|
|||||||
res = self.client.get(reverse(self.ADDMONITOR_PATH))
|
res = self.client.get(reverse(self.ADDMONITOR_PATH))
|
||||||
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
self.assertTemplateUsed(res, 'project/loadbalancers/addmonitor.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
self.assertEqual(workflow.name, AddMonitor.name)
|
self.assertEqual(workflow.name, AddMonitor.name)
|
||||||
|
|
||||||
expected_objs = ['<AddMonitorStep: addmonitoraction>', ]
|
expected_objs = ['<AddMonitorStep: addmonitoraction>', ]
|
||||||
@ -526,7 +527,7 @@ class LoadBalancerTests(test.TestCase):
|
|||||||
res = self.client.get(reverse(self.ADDMEMBER_PATH))
|
res = self.client.get(reverse(self.ADDMEMBER_PATH))
|
||||||
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
self.assertTemplateUsed(res, 'project/loadbalancers/addmember.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
self.assertEqual(workflow.name, AddMember.name)
|
self.assertEqual(workflow.name, AddMember.name)
|
||||||
|
|
||||||
expected_objs = ['<AddMemberStep: addmemberaction>', ]
|
expected_objs = ['<AddMemberStep: addmemberaction>', ]
|
||||||
|
@ -85,7 +85,6 @@ class IndexView(tabs.TabView):
|
|||||||
|
|
||||||
class AddPoolView(workflows.WorkflowView):
|
class AddPoolView(workflows.WorkflowView):
|
||||||
workflow_class = AddPool
|
workflow_class = AddPool
|
||||||
template_name = "project/loadbalancers/addpool.html"
|
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
initial = super(AddPoolView, self).get_initial()
|
initial = super(AddPoolView, self).get_initial()
|
||||||
@ -94,7 +93,6 @@ class AddPoolView(workflows.WorkflowView):
|
|||||||
|
|
||||||
class AddVipView(workflows.WorkflowView):
|
class AddVipView(workflows.WorkflowView):
|
||||||
workflow_class = AddVip
|
workflow_class = AddVip
|
||||||
template_name = "project/loadbalancers/addvip.html"
|
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(AddVipView, self).get_context_data(**kwargs)
|
context = super(AddVipView, self).get_context_data(**kwargs)
|
||||||
@ -116,7 +114,6 @@ class AddVipView(workflows.WorkflowView):
|
|||||||
|
|
||||||
class AddMemberView(workflows.WorkflowView):
|
class AddMemberView(workflows.WorkflowView):
|
||||||
workflow_class = AddMember
|
workflow_class = AddMember
|
||||||
template_name = "project/loadbalancers/addmember.html"
|
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
initial = super(AddMemberView, self).get_initial()
|
initial = super(AddMemberView, self).get_initial()
|
||||||
@ -125,7 +122,6 @@ class AddMemberView(workflows.WorkflowView):
|
|||||||
|
|
||||||
class AddMonitorView(workflows.WorkflowView):
|
class AddMonitorView(workflows.WorkflowView):
|
||||||
workflow_class = AddMonitor
|
workflow_class = AddMonitor
|
||||||
template_name = "project/loadbalancers/addmonitor.html"
|
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
initial = super(AddMonitorView, self).get_initial()
|
initial = super(AddMonitorView, self).get_initial()
|
||||||
|
@ -36,7 +36,6 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class CreateView(workflows.WorkflowView):
|
class CreateView(workflows.WorkflowView):
|
||||||
workflow_class = CreateSubnet
|
workflow_class = CreateSubnet
|
||||||
template_name = 'project/networks/subnets/create.html'
|
|
||||||
|
|
||||||
def get_object(self):
|
def get_object(self):
|
||||||
if not hasattr(self, "_object"):
|
if not hasattr(self, "_object"):
|
||||||
@ -59,7 +58,6 @@ class CreateView(workflows.WorkflowView):
|
|||||||
|
|
||||||
class UpdateView(workflows.WorkflowView):
|
class UpdateView(workflows.WorkflowView):
|
||||||
workflow_class = UpdateSubnet
|
workflow_class = UpdateSubnet
|
||||||
template_name = 'project/networks/subnets/update.html'
|
|
||||||
|
|
||||||
def _get_object(self, *args, **kwargs):
|
def _get_object(self, *args, **kwargs):
|
||||||
if not hasattr(self, "_object"):
|
if not hasattr(self, "_object"):
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Create Network" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Create Network") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include "horizon/common/_workflow.html" %}
|
|
||||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Create Subnet" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Create Subnet") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include "horizon/common/_workflow.html" %}
|
|
||||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Update Subnet" %}{% endblock %}
|
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Update Subnet") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
{% include "horizon/common/_workflow.html" %}
|
|
||||||
{% endblock %}
|
|
@ -24,6 +24,7 @@ import netaddr
|
|||||||
from openstack_dashboard import api
|
from openstack_dashboard import api
|
||||||
from openstack_dashboard.test import helpers as test
|
from openstack_dashboard.test import helpers as test
|
||||||
from .workflows import CreateNetwork
|
from .workflows import CreateNetwork
|
||||||
|
from horizon.workflows.views import WorkflowView
|
||||||
|
|
||||||
|
|
||||||
INDEX_URL = reverse('horizon:project:networks:index')
|
INDEX_URL = reverse('horizon:project:networks:index')
|
||||||
@ -225,7 +226,7 @@ class NetworkTests(test.TestCase):
|
|||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
|
|
||||||
workflow = res.context['workflow']
|
workflow = res.context['workflow']
|
||||||
self.assertTemplateUsed(res, 'project/networks/create.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
self.assertEqual(workflow.name, CreateNetwork.name)
|
self.assertEqual(workflow.name, CreateNetwork.name)
|
||||||
expected_objs = ['<CreateNetworkInfo: createnetworkinfoaction>',
|
expected_objs = ['<CreateNetworkInfo: createnetworkinfoaction>',
|
||||||
'<CreateSubnetInfo: createsubnetinfoaction>',
|
'<CreateSubnetInfo: createsubnetinfoaction>',
|
||||||
@ -602,7 +603,7 @@ class NetworkSubnetTests(test.TestCase):
|
|||||||
args=[network.id])
|
args=[network.id])
|
||||||
res = self.client.get(url)
|
res = self.client.get(url)
|
||||||
|
|
||||||
self.assertTemplateUsed(res, 'project/networks/subnets/create.html')
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
|
|
||||||
@test.create_stubs({api.quantum: ('network_get',
|
@test.create_stubs({api.quantum: ('network_get',
|
||||||
'subnet_create',)})
|
'subnet_create',)})
|
||||||
@ -759,8 +760,7 @@ class NetworkSubnetTests(test.TestCase):
|
|||||||
|
|
||||||
expected_msg = 'Network Address and IP version are inconsistent.'
|
expected_msg = 'Network Address and IP version are inconsistent.'
|
||||||
self.assertFormErrors(res, 1, expected_msg)
|
self.assertFormErrors(res, 1, expected_msg)
|
||||||
self.assertTemplateUsed(res,
|
self.assertTemplateUsed(res, WorkflowView.template_name)
|
||||||
'project/networks/subnets/create.html')
|
|
||||||
|
|
||||||
@test.create_stubs({api.quantum: ('network_get',)})
|
@test.create_stubs({api.quantum: ('network_get',)})
|
||||||
def test_subnet_create_post_gw_inconsistent(self):
|
def test_subnet_create_post_gw_inconsistent(self):
|
||||||
|
@ -58,7 +58,6 @@ class IndexView(tables.DataTableView):
|
|||||||
|
|
||||||
class CreateView(workflows.WorkflowView):
|
class CreateView(workflows.WorkflowView):
|
||||||
workflow_class = CreateNetwork
|
workflow_class = CreateNetwork
|
||||||
template_name = 'project/networks/create.html'
|
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user