Exemplo n.º 1
0
    def test_experiment_with_re_enabled_enrollment(self):
        experiment = ExperimentFactory.create_with_status(
            target_status=Experiment.STATUS_LIVE, normandy_id=1234, is_paused=True
        )
        self.mock_normandy_requests_get.return_value = (
            self.buildMockSucessWithNoPauseEnrollment()
        )
        recipe_data = normandy.get_recipe(experiment.normandy_id)
        tasks.set_is_paused_value_task(experiment.id, recipe_data)
        experiment = Experiment.objects.get(normandy_id=1234)

        self.assertEqual(experiment.status, Experiment.STATUS_LIVE)
        self.assertFalse(experiment.is_paused)

        self.assertEquals(experiment.changes.latest().message, "Enrollment Re-enabled")
Exemplo n.º 2
0
    def test_set_is_paused_value_with_bad_recipe(self):

        experiment = ExperimentFactory.create_with_status(
            target_status=Experiment.STATUS_ACCEPTED, normandy_id=12345)
        recipe_data = {}

        tasks.set_is_paused_value_task(experiment.id, recipe_data)

        experiment = Experiment.objects.get(id=experiment.id)

        self.assertFalse(experiment.is_paused)
        self.assertFalse(
            experiment.changes.filter(
                changed_by__email=settings.NORMANDY_DEFAULT_CHANGELOG_USER,
                message="Enrollment Completed",
            ).exists())