~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/scripts/tests/test_bugnotification.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-03-21 14:12:41 UTC
  • mfrom: (12631.1.2 mail-header-discrepancy)
  • Revision ID: launchpad@pqm.canonical.com-20110321141241-thyagp068cj7g1q6
[r=henninge][no-qa] Do not mention 'filters' in bug subscription
        email headers and body, solely use 'subscription' instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
961
961
        for message in messages:
962
962
            if by_person:
963
963
                headers[message['to']] = message.get_all(
964
 
                    "X-Launchpad-Subscription-Filter", [])
 
964
                    "X-Launchpad-Subscription", [])
965
965
            else:
966
966
                headers = headers.union(
967
967
                    set(message.get_all(
968
 
                        "X-Launchpad-Subscription-Filter", [])))
 
968
                        "X-Launchpad-Subscription", [])))
969
969
        return headers
970
970
 
971
971
    def getSubscriptionEmailBody(self, by_person=False):
978
978
        for message in messages:
979
979
            filters_line = None
980
980
            for line in message.get_payload().splitlines():
981
 
                if line.startswith("Matching filters: "):
 
981
                if line.startswith("Matching subscriptions: "):
982
982
                    filters_line = line
983
983
                    break
984
984
            if filters_line is not None:
1040
1040
        # include that particular filter description in the body.
1041
1041
        bug_filter = self.addFilter(u"Test filter")
1042
1042
 
1043
 
        self.assertContentEqual([u"Matching filters: Test filter"],
 
1043
        self.assertContentEqual([u"Matching subscriptions: Test filter"],
1044
1044
                                self.getSubscriptionEmailBody())
1045
1045
 
1046
1046
    def test_body_multiple(self):
1050
1050
        bug_filter = self.addFilter(u"Second filter")
1051
1051
 
1052
1052
        self.assertContentEqual(
1053
 
            [u"Matching filters: First filter, Second filter"],
 
1053
            [u"Matching subscriptions: First filter, Second filter"],
1054
1054
            self.getSubscriptionEmailBody())