From 93f612354500c0f589244d5985a2da0d12ae050c Mon Sep 17 00:00:00 2001 From: Sam Splunks <72095718+samsplunks@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:07:08 +0000 Subject: [PATCH] Reverting to TestCase client --- helpdesk/tests/test_kb.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/helpdesk/tests/test_kb.py b/helpdesk/tests/test_kb.py index 4430bf17..d6c64560 100644 --- a/helpdesk/tests/test_kb.py +++ b/helpdesk/tests/test_kb.py @@ -64,20 +64,19 @@ class KBTests(TestCase): self.assertContains(response, '1 open tickets') def test_kb_vote(self): - client = Client(enforce_csrf_checks=True) - client.login(username=self.user.get_username(), + self.client.login(username=self.user.get_username(), password='password') - response = client.post( + response = self.client.post( reverse('helpdesk:kb_vote', args=(self.kbitem1.pk, "up")), params={}) cat_url = reverse('helpdesk:kb_category', args=("test_cat",)) + "?kbitem=1" self.assertRedirects(response, cat_url) - response = client.get(cat_url) + response = self.client.get(cat_url) self.assertContains(response, '1 people found this answer useful of 1') - response = client.post( + response = self.client.post( reverse('helpdesk:kb_vote', args=(self.kbitem1.pk, "down")), params={}) self.assertRedirects(response, cat_url) - response = client.get(cat_url) + response = self.client.get(cat_url) self.assertContains(response, '0 people found this answer useful of 1') def test_kb_category_iframe(self):