def test_serializer_outputs_expected_schema_for_addon_experiment(self): experiment = ExperimentFactory.create_with_status( Experiment.STATUS_SHIP, type=Experiment.TYPE_ADDON, locales=[LocaleFactory.create()], countries=[CountryFactory.create()], ) serializer = ExperimentRecipeSerializer(experiment) self.assertEqual(serializer.data["action_name"], "opt-out-study") self.assertEqual(serializer.data["name"], experiment.name) self.assertEqual( serializer.data["comment"], experiment.client_matching ) self.assertEqual( serializer.data["filter_object"], [ FilterObjectBucketSampleSerializer(experiment).data, FilterObjectChannelSerializer(experiment).data, FilterObjectLocaleSerializer(experiment).data, FilterObjectCountrySerializer(experiment).data, ], ) self.assertEqual( serializer.data["arguments"], ExperimentRecipeAddonArgumentsSerializer(experiment).data, )
def test_serializer_outputs_expected_schema(self): experiment = ExperimentFactory.create_with_status( Experiment.STATUS_SHIP) serializer = ExperimentRecipeAddonArgumentsSerializer(experiment) self.assertEqual( serializer.data, { "name": experiment.addon_experiment_id, "description": experiment.public_description, }, )