~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/tests/test_bugchanges.py

[rs=buildbot-poller] automatic merge from stable. Revisions: 14176,
        14177, 14178 included.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from lp.bugs.interfaces.cve import ICveSet
26
26
from lp.bugs.model.bugnotification import BugNotification
27
27
from lp.bugs.scripts.bugnotification import construct_email_notifications
 
28
from lp.services.features.testing import FeatureFixture
28
29
from lp.testing import (
 
30
    login_person,
29
31
    person_logged_in,
30
32
    TestCaseWithFactory,
31
33
    )
1403
1405
            expected_activity=expected_activity,
1404
1406
            expected_notification=expected_notification)
1405
1407
 
 
1408
    def test_bugtask_deleted(self):
 
1409
        # Deleting a bug task adds entries in both BugActivity and
 
1410
        # BugNotification.
 
1411
        target = self.factory.makeProduct()
 
1412
        task_to_delete = self.bug.addTask(self.user, target)
 
1413
        self.saveOldChanges()
 
1414
 
 
1415
        login_person(self.user)
 
1416
        flags = {u"disclosure.delete_bugtask.enabled": u"on"}
 
1417
        with FeatureFixture(flags):
 
1418
            task_to_delete.delete()
 
1419
 
 
1420
        task_deleted_activity = {
 
1421
            'person': self.user,
 
1422
            'whatchanged': 'bug task deleted',
 
1423
            'oldvalue': target.bugtargetname,
 
1424
            }
 
1425
 
 
1426
        task_deleted_notification = {
 
1427
            'person': self.user,
 
1428
            'text': (
 
1429
                "** No longer affects: %s" % target.bugtargetname),
 
1430
            }
 
1431
 
 
1432
        self.assertRecordedChange(
 
1433
            expected_notification=task_deleted_notification,
 
1434
            expected_activity=task_deleted_activity)
 
1435
 
1406
1436
    def test_product_series_nominated(self):
1407
1437
        # Nominating a bug to be fixed in a product series adds an item
1408
1438
        # to the activity log only.