~raj-abhilash1/mailman/gsoc

« back to all changes in this revision

Viewing changes to src/mailman/model/tests/test_member.py

  • Committer: Barry Warsaw
  • Date: 2014-03-02 21:38:32 UTC
  • Revision ID: barry@list.org-20140302213832-tkgvano62vsw67r0
* Module coding style consistency.
* handle_SubscriptionEvent(): We're always guaranteed to get a language from a
  member, since lookup falls back ultimately to the system preferences.  So
  this method can be simplified.
* Bump up code coverage for several modules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Test members."""
19
19
 
20
 
from __future__ import absolute_import, unicode_literals
 
20
from __future__ import absolute_import, print_function, unicode_literals
21
21
 
22
22
__metaclass__ = type
23
23
__all__ = [
 
24
    'TestMember',
24
25
    ]
25
26
 
26
27
 
27
28
import unittest
28
29
 
29
30
from mailman.app.lifecycle import create_list
30
 
from mailman.interfaces.member import MembershipError
 
31
from mailman.interfaces.member import MemberRole, MembershipError
31
32
from mailman.interfaces.user import UnverifiedAddressError
32
33
from mailman.interfaces.usermanager import IUserManager
 
34
from mailman.model.member import Member
33
35
from mailman.testing.layers import ConfigLayer
34
36
from mailman.utilities.datetime import now
35
37
 
94
96
        # The new address is not verified.
95
97
        self.assertRaises(MembershipError,
96
98
                          setattr, member, 'address', bart_address)
 
99
 
 
100
    def test_member_ctor_value_error(self):
 
101
        # ValueError when passing in anything but a user or address.
 
102
        self.assertRaises(ValueError, Member, MemberRole.member,
 
103
                          self._mlist.list_id,
 
104
                          'aperson@example.com')