summaryrefslogtreecommitdiff
path: root/service/test/support/integration/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/test/support/integration/model.py')
-rw-r--r--service/test/support/integration/model.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/service/test/support/integration/model.py b/service/test/support/integration/model.py
index e90a3ec5..c6f6a754 100644
--- a/service/test/support/integration/model.py
+++ b/service/test/support/integration/model.py
@@ -15,6 +15,7 @@
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
import json
+from pixelated.support import date
from pixelated.adapter.model.mail import InputMail
from pixelated.adapter.model.status import Status
@@ -26,7 +27,8 @@ class MailBuilder:
'to': ['recipient@to.com'],
'cc': ['recipient@cc.com'],
'bcc': ['recipient@bcc.com'],
- 'subject': 'Hi! This the subject'
+ 'subject': 'Hi! This the subject',
+ 'date': date.mail_date_now()
},
'body': "Hello,\nThis is the body of this message\n\nRegards,\n\n--\nPixelated.\n",
'status': []
@@ -45,6 +47,10 @@ class MailBuilder:
self.mail['header']['subject'] = subject
return self
+ def with_from(self, sender):
+ self.mail['header']['from'] = sender
+ return self
+
def with_to(self, to):
self.mail['header']['to'] = to
return self
@@ -76,6 +82,9 @@ class MailBuilder:
def build_input_mail(self):
return InputMail.from_dict(self.mail)
+ def build_leap_mail(self):
+ return LeapMail.from_dict(self.mail)
+
class ResponseMail:
def __init__(self, mail_dict):