From 45ce0615e1d58962bc46e33d17148afc31cfc06f Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Thu, 2 Jun 2016 11:02:43 +0200 Subject: [PATCH] Save the sns messages in the PlatformEndpoint This makes it easier to test the correct sns messages are sent --- moto/sns/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moto/sns/models.py b/moto/sns/models.py index 1369ed070..a80d8371c 100644 --- a/moto/sns/models.py +++ b/moto/sns/models.py @@ -119,6 +119,7 @@ class PlatformEndpoint(object): self.token = token self.attributes = attributes self.id = uuid.uuid4() + self.messages = OrderedDict() @property def arn(self): @@ -130,8 +131,9 @@ class PlatformEndpoint(object): ) def publish(self, message): - message_id = six.text_type(uuid.uuid4()) # This is where we would actually send a message + message_id = six.text_type(uuid.uuid4()) + self.messages[message_id] = message return message_id