launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #27813
[Merge] ~cjwatson/launchpad:fix-prevent-email-disclosure into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:fix-prevent-email-disclosure into launchpad:master.
Commit message:
Fix mirror notification doctests
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/412708
These were broken by changes to prevent email address disclosure by sending notifications to different people in different emails.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-prevent-email-disclosure into launchpad:master.
diff --git a/lib/lp/registry/doc/distribution-mirror.txt b/lib/lp/registry/doc/distribution-mirror.txt
index 8939a83..2c7cac5 100644
--- a/lib/lp/registry/doc/distribution-mirror.txt
+++ b/lib/lp/registry/doc/distribution-mirror.txt
@@ -367,11 +367,14 @@ up on the public mirror listings.
>>> import email
>>> from lp.services.mail import stub
>>> len(stub.test_emails)
- 2
+ 3
>>> stub.test_emails.sort(key=lambda e: sorted(e[1])) # sort by to_addr
>>> from_addr, to_addrs, raw_message = stub.test_emails.pop(0)
>>> print(pretty(sorted(to_addrs)))
- ['karl@xxxxxxxxxxxxx', 'mark@xxxxxxxxxxx']
+ ['karl@xxxxxxxxxxxxx']
+ >>> from_addr, to_addrs, raw_message = stub.test_emails.pop(0)
+ >>> print(pretty(sorted(to_addrs)))
+ ['mark@xxxxxxxxxxx']
>>> from_addr, to_addrs, raw_message = stub.test_emails.pop(0)
>>> print(pretty(sorted(to_addrs)))
['mark@xxxxxxxxxxx']
@@ -401,10 +404,14 @@ single notification to the distribution's mirror admins.
>>> valid_mirror.disable(notify_owner=False, log=log)
>>> transaction.commit()
>>> len(stub.test_emails)
- 1
- >>> from_addr, to_addrs, raw_message = stub.test_emails.pop()
+ 2
+ >>> stub.test_emails.sort(key=lambda e: sorted(e[1])) # sort by to_addr
+ >>> from_addr, to_addrs, raw_message = stub.test_emails.pop(0)
>>> print(pretty(sorted(to_addrs)))
- ['karl@xxxxxxxxxxxxx', 'mark@xxxxxxxxxxx']
+ ['karl@xxxxxxxxxxxxx']
+ >>> from_addr, to_addrs, raw_message = stub.test_emails.pop(0)
+ >>> print(pretty(sorted(to_addrs)))
+ ['mark@xxxxxxxxxxx']
Now we delete the MirrorProbeRecord we've just created, to make
sure this mirror is probed by our prober script.