def test_run(self):
        # When run it merges from_person into to_person.
        self.transfer_email()
        logger = BufferLogger()
        with log.use(logger):
            self.job.run()

        self.assertEqual(self.to_person, self.from_person.merged)
        self.assertEqual(
            ["DEBUG PersonMergeJob is about to merge ~void into ~gestalt",
             "DEBUG PersonMergeJob has merged ~void into ~gestalt"],
            logger.getLogBuffer().splitlines())
        self.assertEqual(self.to_person, self.from_person.merged)
Exemplo n.º 2
0
    def test_run(self):
        # When run it merges from_person into to_person.
        self.transfer_email()
        logger = BufferLogger()
        with log.use(logger):
            self.job.run()

        self.assertEqual(self.to_person, self.from_person.merged)
        self.assertEqual([
            "DEBUG PersonMergeJob is about to merge ~void into ~gestalt",
            "DEBUG PersonMergeJob has merged ~void into ~gestalt"
        ],
                         logger.getLogBuffer().splitlines())
        self.assertEqual(self.to_person, self.from_person.merged)
 def test_run(self):
     # The email is sent to all the recipients.
     job = make_question_job(
         self.factory, QuestionRecipientSet.ASKER_SUBSCRIBER)
     logger = BufferLogger()
     with log.use(logger):
         job.run()
     self.assertEqual(
         ["DEBUG QuestionEmailJob will send email for question %s." %
          job.question.id,
          "DEBUG QuestionEmailJob has sent email for question %s." %
          job.question.id],
         logger.getLogBuffer().splitlines())
     transaction.commit()
     self.assertEqual(2, len(stub.test_emails))
Exemplo n.º 4
0
 def test_run(self):
     # The email is sent to all the recipients.
     job = make_question_job(self.factory,
                             QuestionRecipientSet.ASKER_SUBSCRIBER)
     logger = BufferLogger()
     with log.use(logger):
         job.run()
     self.assertEqual([
         "DEBUG QuestionEmailJob will send email for question %s." %
         job.question.id,
         "DEBUG QuestionEmailJob has sent email for question %s." %
         job.question.id
     ],
                      logger.getLogBuffer().splitlines())
     transaction.commit()
     self.assertEqual(2, len(stub.test_emails))
Exemplo n.º 5
0
 def test_run(self):
     # The email is sent to all the recipients.
     job = make_question_job(self.factory,
                             QuestionRecipientSet.ASKER_SUBSCRIBER)
     team_subscriber = self.factory.makeTeam()
     job.question.subscribe(team_subscriber)
     logger = BufferLogger()
     with dbuser(config.answertracker.dbuser), log.use(logger):
         job.run()
     self.assertEqual([
         "DEBUG QuestionEmailJob will send email for question %s." %
         job.question.id,
         "DEBUG QuestionEmailJob has sent email for question %s." %
         job.question.id
     ],
                      logger.getLogBuffer().splitlines())
     transaction.commit()
     self.assertEqual(3, len(stub.test_emails))