| 130 | |
| 131 | |
| 132 | class CaptureMail: |
| 133 | # A hack Mail service that simply captures what would be sent. |
| 134 | def __init__(self, app): |
| 135 | app.extensions["mail"] = self |
| 136 | self.sent = [] |
| 137 | self.ascii_attachments = [] |
| 138 | |
| 139 | def send(self, msg): |
| 140 | self.sent.append(msg.body) |
| 141 | |
| 142 | def pop(self): |
| 143 | if len(self.sent): |
| 144 | return self.sent.pop(0) |
| 145 | return None |
| 146 | |
| 147 | |
| 148 | CaptureMail(app) |