~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/tests/test_bugtask.py

[r=sinzui][bug=904902] When a bugtask is deleted,
 also delete any associated BugNomination record so that the bug can
 then be re-nominated against the target again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)
895
896
            form = {
896
897
                'field.actions.delete_bugtask': 'Delete',
897
898
                }
 
899
            extra = {
 
900
                'HTTP_REFERER': bugtask_url,
 
901
                }
 
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))