def test_format_bug_body_lists_countries_locales(self): country = CountryFactory(code="CA", name="Canada") locale = LocaleFactory(code="da", name="Danish") experiment = ExperimentFactory.create(countries=[country], locales=[locale]) body = format_bug_body(experiment) self.assertIn("Countries: Canada (CA)", body) self.assertIn("Locales: Danish (da)", body)
def test_update_bugzilla_addon_experiment(self): experiment = ExperimentFactory.create_with_status( Experiment.STATUS_DRAFT, name="An Experiment", bugzilla_id="123", type=Experiment.TYPE_ADDON, firefox_min_version="56.0", firefox_max_version="", firefox_channel="Nightly", ) update_experiment_bug(experiment) summary = "[Experiment] Add-On Experiment: An Experiment Fx 56.0 Nightly" self.mock_bugzilla_requests_put.assert_called_with( settings.BUGZILLA_UPDATE_URL.format(id=experiment.bugzilla_id), {"summary": summary, "cf_user_story": format_bug_body(experiment)}, )
def test_countries_locales_list_all_when_none_specified(self): experiment = ExperimentFactory.create(countries=[], locales=[]) body = format_bug_body(experiment) self.assertIn("Countries: all", body) self.assertIn("Locales: all", body)