def test_new_author(self):
     # Importing a different committer adds it as an author.
     author = "Another Author <*****@*****.**>"
     self.commitRevision(committer=author)
     self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1)
     db_author = RevisionAuthor.selectOneBy(name=author)
     self.assertEquals(db_author.name, author)
 def test_new_author(self):
     # Importing a different committer adds it as an author.
     author = "Another Author <*****@*****.**>"
     self.commitRevision(committer=author)
     self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1)
     db_author = RevisionAuthor.selectOneBy(name=author)
     self.assertEquals(db_author.name, author)
 def setUp(self):
     # Create a revision author that doesn't have a user yet.
     super(TestNewlyValidatedEmailsLinkRevisionAuthors, self).setUp()
     with dbuser("branchscanner"):
         self.author = RevisionSet()._createRevisionAuthor(
             '"Harry Potter" <*****@*****.**>')
     # Reget the revision author as we have crossed a transaction boundary.
     self.author = RevisionAuthor.byName(self.author.name)
 def setUp(self):
     # Create a revision author that doesn't have a user yet.
     super(TestNewlyValidatedEmailsLinkRevisionAuthors, self).setUp()
     with dbuser("branchscanner"):
         self.author = RevisionSet()._createRevisionAuthor(
             '"Harry Potter" <*****@*****.**>')
     # Reget the revision author as we have crossed a transaction boundary.
     self.author = RevisionAuthor.byName(self.author.name)
 def testGetNameWithoutEmailWithBadEmail(self):
     # If there is an invalid email in the revision author information,
     # name_without_email is an empty string.
     author = RevisionAuthor(name=u'jml@localhost')
     self.assertEqual('', author.name_without_email)
 def testGetNameWithoutEmailWithOneWord(self):
     # If there is no email in the revision author information,
     # name_without_email is the name.
     author = RevisionAuthor(name=u'Jonathan.Lange')
     self.assertEqual('Jonathan.Lange', author.name_without_email)
 def testGetNameWithoutEmailWithNoName(self):
     # If there is no name in the revision author information,
     # name_without_email is an empty string.
     author = RevisionAuthor(name=u'*****@*****.**')
     self.assertEqual('', author.name_without_email)
 def testGetNameWithoutEmailReturnsNamePart(self):
     # name_without_email is equal to the 'name' part of the revision
     # author information.
     author = RevisionAuthor(name=u'Jonathan Lange <*****@*****.**>')
     self.assertEqual(u'Jonathan Lange', author.name_without_email)