66
66
ZopelessDatabaseLayer,
68
68
from lp.answers.model.answercontact import AnswerContact
69
from lp.bugs.interfaces.bugtask import (
69
73
from lp.bugs.model.bugnotification import (
71
75
BugNotificationRecipient,
77
from lp.bugs.model.bugtask import BugTask
73
78
from lp.code.bzr import (
858
863
self._test_AnswerContactPruner(
859
864
AccountStatus.SUSPENDED, ONE_DAY_AGO, expected_count=1)
866
def test_BugTaskIncompleteMigrator(self):
867
# BugTasks with status INCOMPLETE should be either
868
# INCOMPLETE_WITHOUT_RESPONSE or INCOMPLETE_WITH_RESPONSE.
869
# Create a bug with two tasks set to INCOMPLETE and a comment between
871
LaunchpadZopelessLayer.switchDbUser('testadmin')
872
store = IMasterStore(BugTask)
873
bug = self.factory.makeBug()
874
with_response = bug.bugtasks[0]
875
with_response.transitionToStatus(BugTaskStatus.INCOMPLETE, bug.owner)
876
removeSecurityProxy(with_response)._status = BugTaskStatus.INCOMPLETE
878
self.factory.makeBugComment(bug=bug)
880
without_response = self.factory.makeBugTask(bug=bug)
881
without_response.transitionToStatus(
882
BugTaskStatus.INCOMPLETE, bug.owner)
883
removeSecurityProxy(without_response)._status = (
884
BugTaskStatus.INCOMPLETE)
889
store.find(BugTask.id,
890
BugTask.id == with_response.id,
892
BugTaskStatusSearch.INCOMPLETE_WITH_RESPONSE).count())
895
store.find(BugTask.id,
896
BugTask.id == without_response.id,
898
BugTaskStatusSearch.INCOMPLETE_WITHOUT_RESPONSE).count())
861
900
def test_BranchJobPruner(self):
862
901
# Garbo should remove jobs completed over 30 days ago.
863
902
LaunchpadZopelessLayer.switchDbUser('testadmin')