Merge pull request #912 from normanjaeckel/Fix910
Fix wrong question_url_name in ItemDelete view. Fix #910.
This commit is contained in:
commit
d3f673a276
@ -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():
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user