From d76a04f443c47b0e7fe51f0f46f5cca4c2dc5635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Thu, 17 Oct 2013 01:28:29 +0200 Subject: [PATCH] Fix wrong url_name_args in ItemDelete view. Fix #910. --- openslides/agenda/views.py | 1 + tests/agenda/tests.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index 213154aad..5f55f9499 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -243,6 +243,7 @@ class ItemDelete(DeleteView): model = Item question_url_name = 'item_overview' success_url_name = 'item_overview' + url_name_args = [] def get_answer_options(self): if self.object.children.exists(): diff --git a/tests/agenda/tests.py b/tests/agenda/tests.py index d8a93c6ad..a3e849759 100644 --- a/tests/agenda/tests.py +++ b/tests/agenda/tests.py @@ -207,6 +207,13 @@ class ViewTest(TestCase): self.assertIsNone(Item.objects.get(pk=1).parent) self.assertEqual(Item.objects.get(pk=2).parent_id, 1) + def test_delete(self): + response = self.adminClient.get('/agenda/%s/del/' % self.item1.pk) + self.assertRedirects(response, '/agenda/') + response = self.adminClient.post('/agenda/%s/del/' % self.item1.pk, {'yes': 1}) + self.assertRedirects(response, '/agenda/') + self.assertFalse(Item.objects.filter(pk=1).exists()) + class ConfigTest(TestCase): def setUp(self):