~sakuag333/mailman/lmtp-duplicate-id

« back to all changes in this revision

Viewing changes to src/mailman/app/tests/test_membership.py

  • Committer: Barry Warsaw
  • Date: 2012-10-31 16:37:22 UTC
  • mfrom: (7178.1.1 work2)
  • Revision ID: barry@list.org-20121031163722-3lszhsiv9ai0akfp
 * Python 2.7 is not required.  Python 2.6 is no longer officially supported.
   The code base is now also `python2.7 -3` clean, although there are still
   some warnings in 3rd party dependencies.  LP: #1073506

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
                   'Anne Person', '123', DeliveryMode.regular,
138
138
                   system_preferences.preferred_language,
139
139
                   MemberRole.member)
140
 
        try:
 
140
        with self.assertRaises(AlreadySubscribedError) as cm:
141
141
            add_member(self._mlist, 'aperson@example.com',
142
142
                       'Anne Person', '123', DeliveryMode.regular,
143
143
                       system_preferences.preferred_language,
144
144
                       MemberRole.member)
145
 
        except AlreadySubscribedError as exc:
146
 
            self.assertEqual(exc.fqdn_listname, 'test@example.com')
147
 
            self.assertEqual(exc.email, 'aperson@example.com')
148
 
            self.assertEqual(exc.role, MemberRole.member)
149
 
        else:
150
 
            raise AssertionError('AlreadySubscribedError expected')
 
145
        self.assertEqual(cm.exception.fqdn_listname, 'test@example.com')
 
146
        self.assertEqual(cm.exception.email, 'aperson@example.com')
 
147
        self.assertEqual(cm.exception.role, MemberRole.member)
151
148
 
152
149
    def test_add_member_with_different_roles(self):
153
150
        # Adding a member twice with different roles is okay.