# HG changeset patch # User Branko Majic # Date 2013-07-17 21:39:18 # Node ID 40cc47b13d9becbb16b3c888f2453a61669f46ef # Parent 72d37f8490534018de603fd923df768ec46e3547 Noticket: PEP8 fixes. diff --git a/conntrackt/tests/test_models.py b/conntrackt/tests/test_models.py --- a/conntrackt/tests/test_models.py +++ b/conntrackt/tests/test_models.py @@ -127,7 +127,7 @@ class EntityTest(TestCase): new_project = Project.objects.get(pk=2) entity.project = new_project - self.assertRaisesRegexp(ValidationError, "The entity cannot be moved to different project as long as it has valid communications with entities in current project." ,entity.clean) + self.assertRaisesRegexp(ValidationError, "The entity cannot be moved to different project as long as it has valid communications with entities in current project.", entity.clean) class InterfaceTest(TestCase): 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 @@ -194,7 +194,7 @@ class EntityViewTest(ViewTest): expected_incoming_communications = [" Test Entity 1 (TCP:22)>", " Test Entity 1 (ICMP:8)>", " Test Entity 1 (TCP:3306)>", - " Test Entity 1 (TCP:22)>",] + " Test Entity 1 (TCP:22)>"] expected_outgoing_communications = [" Test Entity 2 (UDP:123)>", " Test Entity 3 (UDP:53)>"] @@ -203,7 +203,7 @@ class EntityViewTest(ViewTest): self.assertQuerysetEqual(response.context["interfaces"], expected_interfaces) self.assertQuerysetEqual(response.context["incoming_communications"], expected_incoming_communications) - self.assertQuerysetEqual(response.context["outgoing_communications"], expected_outgoing_communications) + self.assertQuerysetEqual(response.context["outgoing_communications"], expected_outgoing_communications) self.assertEqual(str(response.context["entity"]), "Test Entity 1 (Test Project 1 - Test Location 1)") self.assertContains(response, "Test Entity 1") self.assertContains(response, ":INPUT") @@ -841,7 +841,7 @@ class EntityCreateViewTest(TestCase): Tests if the choice field for project is defaulted to project passed as part of GET parameters. """ - + view = EntityCreateView() view.request = RequestFactory().get("/fake-path?project=1") view.object = None @@ -855,7 +855,7 @@ class EntityCreateViewTest(TestCase): Tests if the choice field for location is defaulted to location passed as part of GET parameters. """ - + view = EntityCreateView() view.request = RequestFactory().get("/fake-path?location=1") view.object = None @@ -935,7 +935,7 @@ class EntityDeleteViewTest(TestCase): """ self.client.login(username="fullperms", password="fullperms") - + response = self.client.get(reverse("entity_delete", args=(1,))) response = self.client.post(reverse("entity_delete", args=(1,)), @@ -1056,7 +1056,7 @@ class InterfaceCreateViewTest(TestCase): Tests if the choice field for entity is defaulted to entity passed as part of GET parameters. """ - + view = InterfaceCreateView() view.request = RequestFactory().get("/fake-path?entity=1") view.object = None @@ -1144,7 +1144,7 @@ class InterfaceUpdateViewTest(TestCase): self.client.login(username="fullperms", password="fullperms") interface = Interface.objects.get(pk=1) - + response = self.client.get(reverse("interface_update", args=(1,))) response = self.client.post(reverse("interface_update", args=(1,)), @@ -1229,7 +1229,7 @@ class InterfaceDeleteViewTest(TestCase): """ self.client.login(username="fullperms", password="fullperms") - + response = self.client.get(reverse("interface_delete", args=(1,))) response = self.client.post(reverse("interface_delete", args=(1,)), diff --git a/conntrackt/views.py b/conntrackt/views.py --- a/conntrackt/views.py +++ b/conntrackt/views.py @@ -469,7 +469,7 @@ class EntityCreateView(MultiplePermissio if location_id: form.fields["location"].queryset = Location.objects.filter(pk=location_id) form.fields["location"].widget.attrs["readonly"] = True - + return form def get_initial(self): @@ -502,7 +502,7 @@ class EntityUpdateView(MultiplePermissio # Raise authorisation denied exception for unmet permissions. raise_exception = True - + class EntityDeleteView(MultiplePermissionsRequiredMixin, DeleteView): """ @@ -680,4 +680,3 @@ class InterfaceDeleteView(MultiplePermis self.success_url = reverse("entity", args=(self.get_object().entity.id,)) return super(InterfaceDeleteView, self).delete(*args, **kwargs) -