~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/mail/tests/test_helpers.py

  • Committer: Curtis Hovey
  • Date: 2011-12-23 17:18:11 UTC
  • mto: This revision was merged to the branch mainline in revision 14599.
  • Revision ID: curtis.hovey@canonical.com-20111223171811-0pl78hw2noohfy4r
Dismantled doctest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
from canonical.launchpad.webapp.interaction import get_current_principal
16
16
from canonical.testing.layers import DatabaseFunctionalLayer
 
17
from canonical.launchpad.helpers import get_contact_email_addresses
17
18
from lp.services.mail.helpers import (
18
19
    ensure_not_weakly_authenticated,
19
20
    ensure_sane_signature_timestamp,
222
223
            team, get_person_or_team('fooix-devs@lists.example.com'))
223
224
 
224
225
 
 
226
class getContactEmailAddresses(TestCaseWithFactory):
 
227
    layer = DatabaseFunctionalLayer
 
228
 
 
229
    def test_user_with_preferredemail(self):
 
230
        user = self.factory.makePerson(
 
231
            email='user@canonical.com', name='user',)
 
232
        result = get_contact_email_addresses(user)
 
233
        self.assertEqual(set(['user@canonical.com']), result)
 
234
 
 
235
 
225
236
def test_suite():
226
237
    suite = DocTestSuite('lp.services.mail.helpers')
227
238
    suite.addTests(unittest.TestLoader().loadTestsFromName(__name__))