Esempio n. 1
0
    def test_add_start_date_comment_task(self):
        experiment = ExperimentFactory.create(normandy_id=12345)
        comment = "Start Date: {} End Date: {}".format(experiment.start_date,
                                                       experiment.end_date)
        expected_call_data = {"comment": comment}

        tasks.add_start_date_comment_task(experiment.id)

        self.mock_bugzilla_requests_post.assert_called_with(
            settings.BUGZILLA_COMMENT_URL.format(id=12345), expected_call_data)
Esempio n. 2
0
    def test_add_start_date_comment_task_failure(self):
        experiment = ExperimentFactory.create(normandy_id=12345)

        self.mock_bugzilla_requests_post.side_effect = RequestException
        with self.assertRaises(bugzilla.BugzillaError):
            tasks.add_start_date_comment_task(experiment.id)