def test_ToJSON(self): attachment = Attachment( **{ "usage_type": "test", "content_type": "test", "length": 1, "sha2": "test", "fileurl": "test", "display": {"en-US": "test"}, "description": {"en-US": "test"}, } ) self.assertEqual( attachment.to_json(), ( '{"sha2": "test", "contentType": "test", ' '"description": {"en-US": "test"}, ' '"usageType": "test", "length": 1, "fileUrl": "test", ' '"display": {"en-US": "test"}}' ), )
def test_ToJSON(self): attachment = Attachment( **{ "usage_type": "test", "content_type": "test", "length": 1, "sha2": "test", "fileurl": "test", "display": { "en-US": "test" }, "description": { "en-US": "test" } }) self.assertEqual( attachment.to_json(), ('{"sha2": "test", "contentType": "test", ' '"description": {"en-US": "test"}, ' '"usageType": "test", "length": 1, "fileUrl": "test", ' '"display": {"en-US": "test"}}'))
def test_ToJSONEmpty(self): attachment = Attachment() self.assertEqual(attachment.to_json(), '{}')
def test_ToJSONEmpty(self): attachment = Attachment() self.assertEqual(attachment.to_json(), '{}')