889
889
# Test that the delete action works as expected.
890
890
bug = self.factory.makeBug()
891
891
bugtask = self.factory.makeBugTask(bug=bug)
892
bugtask_url = canonical_url(bugtask, rootsite='bugs')
892
893
target_name = bugtask.bugtargetdisplayname
893
894
with FeatureFixture(DELETE_BUGTASK_ENABLED):
894
895
login_person(bugtask.owner)
896
897
'field.actions.delete_bugtask': 'Delete',
900
'HTTP_REFERER': bugtask_url,
902
server_url = canonical_url(
903
getUtility(ILaunchpadRoot), rootsite='bugs')
898
904
view = create_initialized_view(
899
bugtask, name='+delete', form=form, principal=bugtask.owner)
905
bugtask, name='+delete', form=form, server_url=server_url,
906
principal=bugtask.owner, **extra)
900
907
self.assertEqual([bug.default_bugtask], bug.bugtasks)
901
908
notifications = view.request.response.notifications
902
909
self.assertEqual(1, len(notifications))