diff --git a/moto/sns/models.py b/moto/sns/models.py index 4fa72a7d0..0ccf60ea9 100644 --- a/moto/sns/models.py +++ b/moto/sns/models.py @@ -28,7 +28,7 @@ class Topic(object): self.display_name = "" self.policy = json.dumps(DEFAULT_TOPIC_POLICY) self.delivery_policy = "" - self.effective_delivery_policy = DEFAULT_EFFECTIVE_DELIVERY_POLICY + self.effective_delivery_policy = json.dumps(DEFAULT_EFFECTIVE_DELIVERY_POLICY) self.arn = make_arn_for_topic( self.account_id, name, sns_backend.region_name) @@ -317,7 +317,7 @@ DEFAULT_TOPIC_POLICY = { }] } -DEFAULT_EFFECTIVE_DELIVERY_POLICY = json.dumps({ +DEFAULT_EFFECTIVE_DELIVERY_POLICY = { 'http': { 'disableSubscriptionOverrides': False, 'defaultHealthyRetryPolicy': { @@ -330,4 +330,4 @@ DEFAULT_EFFECTIVE_DELIVERY_POLICY = json.dumps({ 'backoffFunction': 'linear' } } -}) +} diff --git a/tests/test_sns/test_publishing.py b/tests/test_sns/test_publishing.py index 718bce5c4..51042675f 100644 --- a/tests/test_sns/test_publishing.py +++ b/tests/test_sns/test_publishing.py @@ -6,7 +6,7 @@ from freezegun import freeze_time import sure # noqa from moto.packages.responses import responses -from moto import mock_sns, mock_sns_deprecated, mock_sqs_deprecated +from moto import mock_sns_deprecated, mock_sqs_deprecated @mock_sqs_deprecated @@ -54,7 +54,6 @@ def test_publish_to_sqs_in_different_region(): @freeze_time("2013-01-01") -@mock_sns @mock_sns_deprecated def test_publish_to_http(): responses.add( diff --git a/tests/test_sns/test_topics.py b/tests/test_sns/test_topics.py index cbb4849c8..1b039c51d 100644 --- a/tests/test_sns/test_topics.py +++ b/tests/test_sns/test_topics.py @@ -82,7 +82,7 @@ def test_topic_attributes(): attributes["SubscriptionsConfirmed"].should.equal(0) attributes["SubscriptionsDeleted"].should.equal(0) attributes["DeliveryPolicy"].should.equal("") - attributes["EffectiveDeliveryPolicy"].should.equal( + json.loads(attributes["EffectiveDeliveryPolicy"]).should.equal( DEFAULT_EFFECTIVE_DELIVERY_POLICY) # boto can't handle prefix-mandatory strings: diff --git a/tests/test_sns/test_topics_boto3.py b/tests/test_sns/test_topics_boto3.py index bfa9b5d1f..4702744c3 100644 --- a/tests/test_sns/test_topics_boto3.py +++ b/tests/test_sns/test_topics_boto3.py @@ -78,7 +78,7 @@ def test_topic_attributes(): attributes["SubscriptionsConfirmed"].should.equal('0') attributes["SubscriptionsDeleted"].should.equal('0') attributes["DeliveryPolicy"].should.equal("") - attributes["EffectiveDeliveryPolicy"].should.equal( + json.loads(attributes["EffectiveDeliveryPolicy"]).should.equal( DEFAULT_EFFECTIVE_DELIVERY_POLICY) # boto can't handle prefix-mandatory strings: