summaryrefslogtreecommitdiff
path: root/service/test
diff options
context:
space:
mode:
Diffstat (limited to 'service/test')
-rw-r--r--service/test/integration/search_test.py11
-rw-r--r--service/test/support/integration_helper.py2
2 files changed, 13 insertions, 0 deletions
diff --git a/service/test/integration/search_test.py b/service/test/integration/search_test.py
index ac91f0b0..735f8b8d 100644
--- a/service/test/integration/search_test.py
+++ b/service/test/integration/search_test.py
@@ -108,3 +108,14 @@ class SearchTest(unittest.TestCase, SoledadTestBase):
for tag in tags_count:
if tag['name'] == mailbox:
return tag['counts']
+
+ def test_order_by_date(self):
+ input_mail = MailBuilder().with_date('2014-10-15T15:15').build_input_mail()
+ input_mail2 = MailBuilder().with_date('2014-10-15T15:14').build_input_mail()
+
+ self.add_mail_to_inbox(input_mail)
+ self.add_mail_to_inbox(input_mail2)
+
+ results = self.get_mails_by_tag('inbox')
+ self.assertEqual(results[0].ident, input_mail2.ident)
+ self.assertEqual(results[1].ident, input_mail.ident)
diff --git a/service/test/support/integration_helper.py b/service/test/support/integration_helper.py
index e6d9b96f..c3233daa 100644
--- a/service/test/support/integration_helper.py
+++ b/service/test/support/integration_helper.py
@@ -118,6 +118,8 @@ class MailBuilder:
for status in Status.from_flags(flags):
self.mail['status'].append(status)
+ def with_date(self, date_string):
+ self.mail['header']['date'] = date_string
return self
def with_ident(self, ident):