SNS - Do not pass empty subject (#4679)
This commit is contained in:
parent
bc6f6c1618
commit
b8cd79cd06
@ -312,7 +312,6 @@ class Subscription(BaseModel):
|
|||||||
"Type": "Notification",
|
"Type": "Notification",
|
||||||
"MessageId": message_id,
|
"MessageId": message_id,
|
||||||
"TopicArn": self.topic.arn,
|
"TopicArn": self.topic.arn,
|
||||||
"Subject": subject,
|
|
||||||
"Message": message,
|
"Message": message,
|
||||||
"Timestamp": iso_8601_datetime_with_milliseconds(
|
"Timestamp": iso_8601_datetime_with_milliseconds(
|
||||||
datetime.datetime.utcnow()
|
datetime.datetime.utcnow()
|
||||||
@ -324,6 +323,8 @@ class Subscription(BaseModel):
|
|||||||
DEFAULT_ACCOUNT_ID
|
DEFAULT_ACCOUNT_ID
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
if subject:
|
||||||
|
post_data["Subject"] = subject
|
||||||
if message_attributes:
|
if message_attributes:
|
||||||
post_data["MessageAttributes"] = message_attributes
|
post_data["MessageAttributes"] = message_attributes
|
||||||
return post_data
|
return post_data
|
||||||
|
@ -416,7 +416,7 @@ def test_publish_null_subject():
|
|||||||
|
|
||||||
acquired_message = json.loads(messages[0].body)
|
acquired_message = json.loads(messages[0].body)
|
||||||
acquired_message["Message"].should.equal(message)
|
acquired_message["Message"].should.equal(message)
|
||||||
acquired_message["Subject"].should.equal(None)
|
acquired_message.shouldnt.have.key("Subject")
|
||||||
|
|
||||||
|
|
||||||
@mock_sns
|
@mock_sns
|
||||||
|
Loading…
Reference in New Issue
Block a user