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 @@ -157,7 +157,7 @@ class ProjectViewTest(ViewTest): self.assertContains(response, "Test Location 2") -class EntityView(ViewTest): +class EntityViewTest(ViewTest): def test_permission_denied(self): """ @@ -190,6 +190,19 @@ class EntityView(ViewTest): response = self.client.get(reverse("entity", args=(1,))) + expected_incoming_communications = [" Test Entity 1 (TCP:22)>", + " Test Entity 1 (ICMP:8)>", + " Test Entity 1 (TCP:3306)>", + " Test Entity 1 (TCP:22)>",] + + expected_outgoing_communications = [" Test Entity 2 (UDP:123)>", + " Test Entity 3 (UDP:53)>"] + + expected_interfaces = [""] + + 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.assertEqual(str(response.context["entity"]), "Test Entity 1 (Test Project 1 - Test Location 1)") self.assertContains(response, "Test Entity 1") self.assertContains(response, ":INPUT")