(self)
| 102 | assert msg.get_body_text() == "content" |
| 103 | |
| 104 | def test_to_api_data(self): |
| 105 | msg = message( |
| 106 | __cloud_data__={ |
| 107 | "id": "123", |
| 108 | "isDraft": False, |
| 109 | "body": {"content": "<html><body>"}, |
| 110 | } |
| 111 | ) |
| 112 | msg.to.add("alice@example.com") |
| 113 | msg.cc.add("alice@example.com") |
| 114 | msg.bcc.add("alice@example.com") |
| 115 | msg.reply_to.add("alice@example.com") |
| 116 | msg.sender = "alice@example.com" |
| 117 | assert msg.to_api_data() == { |
| 118 | "body": {"content": "<html><body>", "contentType": "HTML"}, |
| 119 | "conversationId": None, |
| 120 | "flag": {"flagStatus": "notFlagged"}, |
| 121 | "hasAttachments": False, |
| 122 | "id": "123", |
| 123 | "importance": "normal", |
| 124 | "isDeliveryReceiptRequested": False, |
| 125 | "isDraft": False, |
| 126 | "isRead": None, |
| 127 | "isReadReceiptRequested": False, |
| 128 | "subject": "", |
| 129 | "parentFolderId": None, |
| 130 | "from": {"emailAddress": {"address": "alice@example.com"}}, |
| 131 | "toRecipients": [{"emailAddress": {"address": "alice@example.com"}}], |
| 132 | "bccRecipients": [{"emailAddress": {"address": "alice@example.com"}}], |
| 133 | "ccRecipients": [{"emailAddress": {"address": "alice@example.com"}}], |
| 134 | "replyTo": [{"emailAddress": {"address": "alice@example.com"}}], |
| 135 | } |
| 136 | |
| 137 | |
| 138 | class TestMessageApiCalls: |
nothing calls this directly
no test coverage detected