~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/identity/doc/emailaddress.txt

  • Committer: William Grant
  • Date: 2012-01-04 23:49:46 UTC
  • mto: This revision was merged to the branch mainline in revision 14635.
  • Revision ID: william.grant@canonical.com-20120104234946-i1hbapx9288jjoay
EmailAddressSet.new now infers account from person where possible. Fix redundant tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
    >>> personset = getUtility(IPersonSet)
37
37
    >>> foobar = personset.getByName('name16')
38
 
    >>> emailset.new(email.email, foobar, account=foobar.account)
 
38
    >>> emailset.new(email.email, foobar)
39
39
    Traceback (most recent call last):
40
40
    ...
41
41
    EmailAddressAlreadyTaken: The email address '...' is already registered.
42
42
 
43
43
The email address verification is case insensitive as well:
44
44
 
45
 
    >>> emailset.new(email.email.upper(), foobar, account=foobar.account)
 
45
    >>> emailset.new(email.email.upper(), foobar)
46
46
    Traceback (most recent call last):
47
47
    ...
48
48
    EmailAddressAlreadyTaken: The email address '...' is already registered.
50
50
Registering a new email address works -- and preserves case -- though:
51
51
 
52
52
    >>> emailaddress = emailset.new(
53
 
    ...     'oink@Canonical.com', foobar, account=foobar.account)
 
53
    ...     'oink@Canonical.com', foobar)
54
54
    >>> emailaddress.email
55
55
    u'oink@Canonical.com'
56
56