~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/model/tests/test_revisionauthor.py

  • Committer: Jeroen Vermeulen
  • Date: 2011-12-22 09:05:46 UTC
  • mto: This revision was merged to the branch mainline in revision 14583.
  • Revision ID: jeroen.vermeulen@canonical.com-20111222090546-6ctytqkw7zhqq1xy
Lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
 
95
95
    def test_new_harry_not_linked(self):
96
96
        # Check a NEW email address is not used to link.
97
 
        harry = self._makeHarry(EmailAddressStatus.NEW)
 
97
        self._makeHarry(EmailAddressStatus.NEW)
98
98
        author = self._createRevisionAuthor()
99
99
        self.assertEqual('harry@canonical.com', author.email)
100
100
        self.assertEqual(None, author.person)
146
146
 
147
147
    def test_validated_email_updates(self):
148
148
        # A newly validated email for a user.
149
 
        self.assertEqual(None, self.author.person,
150
 
                         'No author should be initially set.')
 
149
        self.assertEqual(
 
150
            None, self.author.person, "No author should be initially set.")
151
151
        harry = self._makeHarry(EmailAddressStatus.NEW)
152
152
        # Since the email address is initially new, there should still be
153
153
        # no link.
154
 
        self.assertEqual(None, self.author.person,
155
 
                         'No author should be set yet.')
 
154
        self.assertEqual(
 
155
            None, self.author.person, "No author should be set yet.")
156
156
        email = harry.guessedemails[0]
157
157
        harry.validateAndEnsurePreferredEmail(email)
158
 
        transaction.commit() # Sync all changes
 
158
        transaction.commit()  # Sync changes.
159
159
 
160
160
        # The link still hasn't been created at this point.
161
 
        self.assertEqual(None, self.author.person,
162
 
                         'No author should be set yet.')
 
161
        self.assertEqual(
 
162
            None, self.author.person, "No author should be set yet.")
163
163
 
164
164
        # After the garbo RevisionAuthorEmailLinker job runs, the link
165
165
        # is made.
166
166
        RevisionAuthorEmailLinker(log=DevNullLogger()).run()
167
 
        self.assertEqual(harry, self.author.person,
168
 
                         'Harry should now be the author.')
 
167
        self.assertEqual(
 
168
            harry, self.author.person, "Harry should now be the author.")
169
169
 
170
170
 
171
171
class TestRevisionAuthor(TestCase):