From 222a4c82a34a3992e6477c68fc9434bf07bc31a0 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 31 May 2020 01:09:47 +0000 Subject: [PATCH] fix diskcheck test again --- api/tacticalrmm/checks/tests.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/tacticalrmm/checks/tests.py b/api/tacticalrmm/checks/tests.py index bc90ee7b..41c9c9a6 100644 --- a/api/tacticalrmm/checks/tests.py +++ b/api/tacticalrmm/checks/tests.py @@ -16,7 +16,7 @@ class TestCheckViews(BaseTestCase): self.assertEqual(resp.data, serializer.data) self.check_not_authenticated("post", url) - def test_add_diskcheck(self): + def test_add_disk_check(self): url = "/checks/checks/" self.valid_payload = { @@ -43,7 +43,7 @@ class TestCheckViews(BaseTestCase): }, } - resp = self.client.post(url, self.valid_payload, format="json") + resp = self.client.post(url, self.invalid_payload, format="json") self.assertEqual(resp.status_code, 400) def test_get_policy_disk_check(self): @@ -56,11 +56,11 @@ class TestCheckViews(BaseTestCase): self.assertEqual(resp.data, serializer.data) self.check_not_authenticated("post", url) - def test_add_policy_diskcheck(self): + def test_add_policy_disk_check(self): url = "/checks/checks/" self.valid_payload = { - "pk": self.policy.pk, + "policy": self.policy.pk, "check": { "check_type": "diskspace", "disk": "D:", @@ -74,7 +74,7 @@ class TestCheckViews(BaseTestCase): # this should fail because we already have a check for drive M: in setup self.invalid_payload = { - "pk": self.policy.pk, + "policy": self.policy.pk, "check": { "check_type": "diskspace", "disk": "M:", @@ -83,7 +83,7 @@ class TestCheckViews(BaseTestCase): }, } - resp = self.client.post(url, self.valid_payload, format="json") + resp = self.client.post(url, self.invalid_payload, format="json") self.assertEqual(resp.status_code, 400) def test_get_disks_for_policies(self):