Code review comment for lp:~wgrant/launchpad/team-verbose-bugnotifications-bug-253788

Revision history for this message
William Grant (wgrant) wrote :

I've added the other case and renamed the variables.

=== modified file 'lib/lp/bugs/doc/bugnotification-sending.txt'
--- lib/lp/bugs/doc/bugnotification-sending.txt 2009-07-23 14:49:07 +0000
+++ lib/lp/bugs/doc/bugnotification-sending.txt 2009-07-23 15:40:14 +0000
@@ -1249,32 +1249,53 @@

 To demonstrate verbose notifications, we'll create a bug, and subscribe
 some very picky users to it. Verbose Person wants verbose emails, while
-Concise Person does not. We'll also create a team with a member that
-wants verbose notifications.
+Concise Person does not. We'll also create teams and give them members
+with different verbose_bugnotifications settings.

     >>> switch_db_to_launchpad()
- >>> bug = factory.makeBug(product=factory.makeProduct(title='Foo'),
- ... title='Foo is broken', description='desc')
-
- >>> vperson = factory.makePerson(displayname='Verbose Person',
- ... <email address hidden>')
- >>> vperson.verbose_bugnotifications = True
- >>> bug.subscribe(vperson, vperson)
- <BugSubscription...>
-
- >>> cperson = factory.makePerson(displayname='Concise Person',
- ... <email address hidden>')
- >>> cperson.verbose_bugnotifications = False
- >>> bug.subscribe(cperson, cperson)
- <BugSubscription...>
-
- >>> team = factory.makeTeam(name='bugteam', displayname='Bug Team')
- >>> team.verbose_bugnotifications = False
- >>> tperson = factory.makePerson(displayname='Team Person',
- ... <email address hidden>')
- >>> tperson.verbose_bugnotifications = True
- >>> team.addMember(tperson, tperson)
- >>> bug.subscribe(team, tperson)
+ >>> bug = factory.makeBug(
+ ... product=factory.makeProduct(title='Foo'), title='Foo is broken',
+ ... description='desc')
+
+ >>> verbose_person = factory.makePerson(
+ ... displayname='Verbose Person', <email address hidden>')
+ >>> verbose_person.verbose_bugnotifications = True
+ >>> bug.subscribe(verbose_person, verbose_person)
+ <BugSubscription...>
+
+ >>> concise_person = factory.makePerson(
+ ... displayname='Concise Person', <email address hidden>')
+ >>> concise_person.verbose_bugnotifications = False
+ >>> bug.subscribe(concise_person, concise_person)
+ <BugSubscription...>
+
+
+Concise Team doesn't want verbose notifications, while Concise Team
+Person, a member, does.
+
+ >>> concise_team = factory.makeTeam(
+ ... name='conciseteam', displayname='Concise Team')
+ >>> concise_team.verbose_bugnotifications = False
+ >>> concise_team_person = factory.makePerson(
+ ... displayname='Concise Team Person',
+ ... <email address hidden>')
+ >>> concise_team_person.verbose_bugnotifications = True
+ >>> concise_team.addMember(concise_team_person, concise_team_person)
+ >>> bug.subscribe(concise_team, concise_team_person)
+ <BugSubscription...>
+
+Verbose Team wants verbose notifications, while Verbose Team Person, a
+member, does not.
+
+ >>> verbose_team = factory.makeTeam(
+ ... name='verboseteam', displayname='Verbose Team')
+ >>> verbose_team.verbose_bugnotifications = True
+ >>> verbose_team_person = factory.makePerson(
+ ... displayname='Verbose Team Person',
+ ... <email address hidden>')
+ >>> verbose_team_person.verbose_bugnotifications = False
+ >>> verbose_team.addMember(verbose_team_person, verbose_team_person)
+ >>> bug.subscribe(verbose_team, verbose_team_person)
     <BugSubscription...>

 We'll expire all existing notifications since we're not interested in
@@ -1296,7 +1317,7 @@
 notifications containing that comment.

     >>> comment = getUtility(IMessageSet).fromText(
- ... 'subject', 'a really simple comment.', vperson,
+ ... 'subject', 'a really simple comment.', verbose_person,
     ... datecreated=ten_minutes_ago)
     >>> bug.addCommentNotification(comment)

@@ -1345,7 +1366,26 @@
     <BLANKLINE>
     ----------------------------------------------------------------------

-Whereas Verbose Person does:
+Neither does Verbose Team Person - while the team wants verbose emails,
+he wants concise ones.
+
+ >>> print_notification(collated_messages['<email address hidden>'][0])
+ To: <email address hidden>
+ From: Verbose Person <email address hidden>
+ Subject: [Bug ...] subject
+ X-Launchpad-Message-Rationale: Subscriber @verboseteam
+ <BLANKLINE>
+ a really simple comment.
+ <BLANKLINE>
+ --
+ Foo is broken
+ http://bugs.launchpad.dev/bugs/...
+ You received this bug notification because you are a member of Verbose
+ Team, which is a direct subscriber.
+ <BLANKLINE>
+ ----------------------------------------------------------------------
+
+Whereas Verbose Person does get the description and task status:

     >>> print_notification(collated_messages['<email address hidden>'][0])
     To: <email address hidden>
@@ -1368,21 +1408,21 @@
     <BLANKLINE>
     ----------------------------------------------------------------------

-And Team Person does too, even though his team doesn't want them:
+And Concise Team Person does too, even though his team doesn't want them:

- >>> print_notification(collated_messages['<email address hidden>'][0])
- To: <email address hidden>
+ >>> print_notification(collated_messages['<email address hidden>'][0])
+ To: <email address hidden>
     From: Verbose Person <email address hidden>
     Subject: [Bug ...] subject
- X-Launchpad-Message-Rationale: Subscriber @bugteam
+ X-Launchpad-Message-Rationale: Subscriber @conciseteam
     <BLANKLINE>
     a really simple comment.
     <BLANKLINE>
     --
     Foo is broken
     http://bugs.launchpad.dev/bugs/...
- You received this bug notification because you are a member of Bug Team,
- which is a direct subscriber.
+ You received this bug notification because you are a member of Concise
+ Team, which is a direct subscriber.
     <BLANKLINE>
     Status in Foo: New
     <BLANKLINE>

« Back to merge proposal