def test_create_new_sms_destination(self): if not "sms" in MEDIA_CLASSES_DICT.keys(): self.skipTest("No sms plugin available") request = self.request_factory.post("/") request.user = self.user validated_data = { "media_id": "sms", "settings": { "phone_number": "+4747474747", }, "user": self.user, } serializer = RequestDestinationConfigSerializer( context={"request": request}, ) obj = serializer.create(validated_data) self.assertEqual( obj.settings, { "phone_number": "+4747474747", }, )
def test_create_new_email_destination(self): request = self.request_factory.post("/") request.user = self.user validated_data = { "media_id": "email", "settings": { "email_address": "*****@*****.**", "synced": False, }, "user": self.user, } serializer = RequestDestinationConfigSerializer( context={"request": request}, ) obj = serializer.create(validated_data) self.assertEqual( obj.settings, { "email_address": "*****@*****.**", "synced": False, }, )