|
@@ -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 = ["<Communication: Test Entity 2 -> Test Entity 1 (TCP:22)>",
|
|
|
"<Communication: Test Entity 2 -> Test Entity 1 (ICMP:8)>",
|
|
|
"<Communication: Test Entity 3 -> Test Entity 1 (TCP:3306)>",
|
|
|
"<Communication: Test Subnet -> Test Entity 1 (TCP:22)>",]
|
|
|
|
|
|
expected_outgoing_communications = ["<Communication: Test Entity 1 -> Test Entity 2 (UDP:123)>",
|
|
|
"<Communication: Test Entity 1 -> Test Entity 3 (UDP:53)>"]
|
|
|
|
|
|
expected_interfaces = ["<Interface: Test Entity 1 (192.168.1.1)>"]
|
|
|
|
|
|
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")
|