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):