Example #1
0
 def test__mergeMailingListSubscriptions_with_subscriptions(self):
     naked_person = removeSecurityProxy(self.from_person)
     naked_person.mailing_list_auto_subscribe_policy = (
         MailingListAutoSubscribePolicy.ALWAYS)
     self.team, self.mailing_list = self.factory.makeTeamAndMailingList(
         'test-mailinglist', 'team-owner')
     with person_logged_in(self.team.teamowner):
         self.team.addMember(self.from_person, reviewer=self.team.teamowner)
     transaction.commit()
     _mergeMailingListSubscriptions(self.cur, self.from_person.id,
                                    self.to_person.id)
     self.assertEqual(1, self.cur.rowcount)
 def test__mergeMailingListSubscriptions_with_subscriptions(self):
     naked_person = removeSecurityProxy(self.from_person)
     naked_person.mailing_list_auto_subscribe_policy = (
         MailingListAutoSubscribePolicy.ALWAYS)
     self.team, self.mailing_list = self.factory.makeTeamAndMailingList(
         'test-mailinglist', 'team-owner')
     with person_logged_in(self.team.teamowner):
         self.team.addMember(
             self.from_person, reviewer=self.team.teamowner)
     transaction.commit()
     _mergeMailingListSubscriptions(
         self.cur, self.from_person.id, self.to_person.id)
     self.assertEqual(1, self.cur.rowcount)
Example #3
0
 def test__mergeMailingListSubscriptions_no_subscriptions(self):
     _mergeMailingListSubscriptions(self.cur, self.from_person.id,
                                    self.to_person.id)
     self.assertEqual(0, self.cur.rowcount)
 def test__mergeMailingListSubscriptions_no_subscriptions(self):
     _mergeMailingListSubscriptions(
         self.cur, self.from_person.id, self.to_person.id)
     self.assertEqual(0, self.cur.rowcount)