diff --git a/conntrackt/tests/test_views.py b/conntrackt/tests/test_views.py --- a/conntrackt/tests/test_views.py +++ b/conntrackt/tests/test_views.py @@ -401,6 +401,7 @@ class ProjectUpdateViewTest(PermissionTe response = generate_get_response(view, None, pk=1) self.assertEqual(response.context_data["project"].name, "Test Project 1") + self.assertEqual(response.context_data["headline"], "Update project Test Project 1") class ProjectDeleteViewTest(PermissionTestMixin, TestCase): @@ -427,6 +428,7 @@ class ProjectDeleteViewTest(PermissionTe response = generate_get_response(view, None, pk=1) self.assertEqual(response.context_data["project"], project) + self.assertEqual(response.context_data["headline"], "Delete project Test Project 1") def test_message(self): """ @@ -475,6 +477,7 @@ class LocationUpdateViewTest(PermissionT response = generate_get_response(view, None, pk=1) self.assertEqual(response.context_data["location"].name, "Test Location 1") + self.assertEqual(response.context_data["headline"], "Update location Test Location 1") class LocationDeleteViewTest(PermissionTestMixin, TestCase): @@ -501,6 +504,7 @@ class LocationDeleteViewTest(PermissionT response = generate_get_response(view, None, pk=1) self.assertEqual(response.context_data["location"], location) + self.assertEqual(response.context_data["headline"], "Delete location Test Location 1") def test_message(self): """ @@ -624,6 +628,7 @@ class EntityDeleteViewTest(PermissionTes response = generate_get_response(view, None, pk=1) self.assertEqual(response.context_data["entity"], entity) + self.assertEqual(response.context_data["headline"], "Delete entity Test Entity 1") def test_message(self): """ @@ -686,6 +691,7 @@ class EntityUpdateViewTest(PermissionTes response = generate_get_response(view, None, pk=1) self.assertEqual(response.context_data["entity"].name, "Test Entity 1") + self.assertEqual(response.context_data["headline"], "Update entity Test Entity 1") class InterfaceCreateViewTest(PermissionTestMixin, TestCase): @@ -782,6 +788,7 @@ class InterfaceUpdateViewTest(Permission interface = Interface.objects.get(pk=1) self.assertEqual(response.context_data["interface"], interface) + self.assertEqual(response.context_data["headline"], "Update interface eth0") def test_form_entity_limit(self): """ @@ -854,6 +861,7 @@ class InterfaceDeleteViewTest(Permission response = generate_get_response(view, None, pk=1) self.assertEqual(response.context_data["interface"], interface) + self.assertEqual(response.context_data["headline"], "Delete interface eth0") def test_message(self): """ @@ -1140,6 +1148,7 @@ class CommunicationUpdateViewTest(Permis communication = Communication.objects.get(pk=1) self.assertEqual(response.context_data["communication"], communication) + self.assertEqual(response.context_data["headline"], "Update communication Test Entity 2 -> Test Entity 1 (TCP:22)") def test_form_interface_limit(self): """ @@ -1242,6 +1251,7 @@ class CommunicationDeleteViewTest(Permis response = generate_get_response(view, None, pk=1) self.assertEqual(response.context_data["communication"], communication) + self.assertEqual(response.context_data["headline"], "Delete communication Test Entity 2 -> Test Entity 1 (TCP:22)") def test_message(self): """ diff --git a/conntrackt/urls.py b/conntrackt/urls.py --- a/conntrackt/urls.py +++ b/conntrackt/urls.py @@ -33,7 +33,6 @@ urlpatterns = patterns( # View for deleting a location. url(r'^location/(?P\d+)/remove/$', LocationDeleteView.as_view(), name="location_delete"), - # View for showing information about an entity. url(r'^entity/(?P\d+)/$', EntityView.as_view(), name='entity'), @@ -64,6 +63,7 @@ urlpatterns = patterns( url(r'^project/(?P\d+)/iptables/$', project_iptables, name="project_iptables"), # View for rendering zip file with iptables rules for all entities in a project for a specific location. url(r'^project/(?P\d+)/location/(?P\d+)/iptables/$', project_iptables, name="project_location_iptables"), + # Views for logging-in/out the users. url(r'^login/$', login, {'template_name': 'conntrackt/login.html'}, name="login"), url(r'^logout/$', logout, name="logout"), diff --git a/conntrackt/views.py b/conntrackt/views.py --- a/conntrackt/views.py +++ b/conntrackt/views.py @@ -778,13 +778,6 @@ class CommunicationCreateView(SetHeadlin return self.request.GET.get("next", reverse("project", args=(self.object.source.entity.project.pk,))) - def get_headline(self): - """ - Set headline based on interface name. - """ - - return "Delete interface %s" % self.object.name - class CommunicationUpdateView(SetHeadlineMixin, MultiplePermissionsRequiredMixin, UpdateView): """