summaryrefslogtreecommitdiff
path: root/service/test/integration
diff options
context:
space:
mode:
authorBruno Wagner <bwgpro@gmail.com>2015-06-05 19:36:08 -0300
committerBruno Wagner <bwgpro@gmail.com>2015-06-05 19:36:08 -0300
commit103cb481bc46e9dc8c5ca047b460265b5d68ee32 (patch)
treeacb7cf1395b879fcd9730766498415fce58d137f /service/test/integration
parenta2886f31583722c5f08a965325156f8eb1e18509 (diff)
Added creation of input mail from python message
That way we don't need extra logic for the welcome mail, we just have to read the file and send the contents to the input mail parser and that's it. Also moved the logic of adding a welcome mail to the mailboxes because it has knowledge of mailbox methods anyways.
Diffstat (limited to 'service/test/integration')
-rw-r--r--service/test/integration/test_contacts.py2
-rw-r--r--service/test/integration/test_tags.py2
-rw-r--r--service/test/integration/test_welcome_mail.py15
3 files changed, 9 insertions, 10 deletions
diff --git a/service/test/integration/test_contacts.py b/service/test/integration/test_contacts.py
index f9cde9e5..1d82b0d7 100644
--- a/service/test/integration/test_contacts.py
+++ b/service/test/integration/test_contacts.py
@@ -87,7 +87,7 @@ class ContactsTest(SoledadTestBase):
self.add_mail_to_inbox(to_be_bounced)
bounced_mail_template = MailBuilder().build_input_mail()
- bounced_mail = self.mailboxes.inbox().add(bounced_mail_template)
+ bounced_mail = self.mailboxes.inbox.add(bounced_mail_template)
bounced_mail.hdoc.content = self._bounced_mail_hdoc_content()
bounced_mail.save()
self.search_engine.index_mail(bounced_mail)
diff --git a/service/test/integration/test_tags.py b/service/test/integration/test_tags.py
index 976b6d96..168e035f 100644
--- a/service/test/integration/test_tags.py
+++ b/service/test/integration/test_tags.py
@@ -86,5 +86,5 @@ class TagsTest(SoledadTestBase):
response = self.post_tags(mail.ident, self._tags_json([tag.name.upper()]))
self.assertEquals("None of the following words can be used as tags: %s" % tag.name, response)
- mail = self.mailboxes.inbox().mail(mail.ident)
+ mail = self.mailboxes.inbox.mail(mail.ident)
self.assertNotIn('drafts', mail.tags)
diff --git a/service/test/integration/test_welcome_mail.py b/service/test/integration/test_welcome_mail.py
index ed37f50e..a5ca555a 100644
--- a/service/test/integration/test_welcome_mail.py
+++ b/service/test/integration/test_welcome_mail.py
@@ -15,21 +15,20 @@
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
from test.support.integration import SoledadTestBase
-from pixelated.config.welcome_mail import check_welcome_mail
class TestWelcomeMail(SoledadTestBase):
- def test_that_a_fresh_INBOX_will_receive_a_welcome_mail_only_once(self):
- inbox = self.mailboxes.inbox()
- check_welcome_mail(inbox) # adds a mail
- check_welcome_mail(inbox) # should not repeat
-
+ def test_welcome_mail_is_added_only_once(self):
+ self.mailboxes.add_welcome_mail_for_fresh_user()
+ self.mailboxes.add_welcome_mail_for_fresh_user()
inbox_mails = self.get_mails_by_tag('inbox')
self.assertEquals(1, len(inbox_mails))
+ def test_empty_mailbox_doesnt_mean_fresh_mailbox(self):
+ self.mailboxes.add_welcome_mail_for_fresh_user()
+ inbox_mails = self.get_mails_by_tag('inbox')
self.delete_mail(inbox_mails[0].ident)
- check_welcome_mail(inbox) # it is empty, but not fresh anymore
-
+ self.mailboxes.add_welcome_mail_for_fresh_user()
inbox_mails = self.get_mails_by_tag('inbox')
self.assertEquals(0, len(inbox_mails))