~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/tests/test_person_vocabularies.py

  • Committer: William Grant
  • Date: 2011-06-14 02:39:43 UTC
  • mto: This revision was merged to the branch mainline in revision 13224.
  • Revision ID: william.grant@canonical.com-20110614023943-wron7qix2eggx3hb
Check that it works for people without nicks too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
    vocabulary_name = 'ValidPersonOrTeam'
140
140
 
141
141
    def test_preloads_irc_nicks_and_preferredemail(self):
 
142
        """Test that IRC nicks and preferred email addresses are preloaded."""
 
143
        # Create three people with IRC nicks, and one without.
142
144
        people = []
143
145
        for num in range(3):
144
146
            person = self.factory.makePerson(displayname='foobar %d' % num)
145
147
            getUtility(IIrcIDSet).new(person, 'launchpad', person.name)
146
148
            people.append(person)
 
149
        people.append(self.factory.makePerson(displayname='foobar 4'))
 
150
 
 
151
        # Remember the current values for checking later, and throw out
 
152
        # the cache.
147
153
        expected_nicks = dict(
148
154
            (person.id, list(person.ircnicknames)) for person in people)
149
155
        expected_emails = dict(
153
159
        with FeatureFixture(PERSON_AFFILIATION_RANK_FLAG):
154
160
            results = list(self.searchVocabulary(None, u'foobar'))
155
161
        with StormStatementRecorder() as recorder:
156
 
            self.assertEquals(3, len(results))
 
162
            self.assertEquals(4, len(results))
157
163
            for person in results:
158
164
                self.assertEqual(
159
165
                    expected_nicks[person.id], person.ircnicknames)