← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~ilasc/launchpad:fix-expose-send-notifications into launchpad:master

 


Diff comments:

> diff --git a/lib/lp/bugs/model/tests/test_bug.py b/lib/lp/bugs/model/tests/test_bug.py
> index 1ce81f9..a2452ff 100644
> --- a/lib/lp/bugs/model/tests/test_bug.py
> +++ b/lib/lp/bugs/model/tests/test_bug.py
> @@ -641,11 +641,17 @@ class TestBug(TestCaseWithFactory):
>              self.assertIsInstance(recorder.events[0], ObjectCreatedEvent)
>  
>      def test_newMessage_send_notification_false(self):
> -        # Notifications about new messages can be suppressed.
> +        # After exposing this over the API extra permissions are required.
> +        # Notifications about new messages can be suppressed
> +        # by admins, commercial admins, registry experts,
> +        # pillar owners, pillar drivers or pillar bug supervisors.
> +        person_set = getUtility(IPersonSet)
> +        admins = person_set.getByName("admins")
> +        admin = admins.teamowner
>          bug = self.factory.makeBug()
> -        login_person(bug.owner)
> +        login_person(admins.teamowner)
>          with EventRecorder() as recorder:
> -            bug.newMessage(owner=bug.owner, send_notifications=False)
> +            bug.newMessage(owner=admin, send_notifications=False)

and just realized this can call the internal method without the need for elevated permissions

>              self.assertEqual(0, len(recorder.events))
>  
>      def test_vulnerabilities_property(self):


-- 
https://code.launchpad.net/~ilasc/launchpad/+git/launchpad/+merge/429828
Your team Launchpad code reviewers is requested to review the proposed merge of ~ilasc/launchpad:fix-expose-send-notifications into launchpad:master.



References