From 2f8b4acf64767ebd080302edb143ff8f012223a0 Mon Sep 17 00:00:00 2001 From: Timothy Hobbs Date: Mon, 20 Jan 2020 14:17:23 +0100 Subject: [PATCH] Fix pycodestyle errors --- helpdesk/tests/test_kb.py | 5 +---- helpdesk/views/kb.py | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/helpdesk/tests/test_kb.py b/helpdesk/tests/test_kb.py index 6eba76bd..9c15e818 100644 --- a/helpdesk/tests/test_kb.py +++ b/helpdesk/tests/test_kb.py @@ -1,4 +1,4 @@ -#queue_publii -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- from django.urls import reverse from django.test import TestCase @@ -61,7 +61,6 @@ class KBTests(TestCase): response = self.client.get(reverse('helpdesk:kb_category', args=("test_cat",))) self.assertContains(response, '1 open tickets') - def test_kb_vote(self): self.client.login(username=self.user.get_username(), password='password') response = self.client.get(reverse('helpdesk:kb_vote', args=(self.kbitem1.pk,)) + "?vote=up") @@ -74,10 +73,8 @@ class KBTests(TestCase): response = self.client.get(cat_url) self.assertContains(response, '0 people found this answer useful of 1') - def test_kb_category_iframe(self): cat_url = reverse('helpdesk:kb_category', args=("test_cat",)) + "?kbitem=1;submitter_email=foo@bar.cz;title=lol;" response = self.client.get(cat_url) # Assert that query params are passed on to ticket submit form self.assertContains(response, "'/helpdesk/tickets/submit/?queue=1;_readonly_fields_=queue;kbitem=1;submitter_email=foo%40bar.cz&title=lol") - diff --git a/helpdesk/views/kb.py b/helpdesk/views/kb.py index bbeacdef..a5d592a7 100644 --- a/helpdesk/views/kb.py +++ b/helpdesk/views/kb.py @@ -52,6 +52,7 @@ def category(request, slug, iframe=False): 'staff': staff, }) + @xframe_options_exempt def category_iframe(request, slug): return category(request, slug, iframe=True)