From 0e4422809ba411a629b03baf705a3a7dd781302f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 13 Sep 2012 13:49:17 +0200 Subject: [PATCH] [IMP] email_template: now inherit from TestMailMockups test class. bzr revid: tde@openerp.com-20120913114917-na341w0ja7n0ditu --- addons/email_template/tests/test_mail.py | 16 ++-------------- addons/portal/tests/test_portal.py | 1 - 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/addons/email_template/tests/test_mail.py b/addons/email_template/tests/test_mail.py index 85ab3afc902..1091c34ad5c 100644 --- a/addons/email_template/tests/test_mail.py +++ b/addons/email_template/tests/test_mail.py @@ -20,17 +20,10 @@ ############################################################################## import base64 -from openerp.tests import common +from openerp.addons.mail.tests import test_mail -class test_message_compose(common.TransactionCase): - def _mock_smtp_gateway(self, *args, **kwargs): - return True - - def _mock_build_email(self, *args, **kwargs): - self._build_email_args = args - self._build_email_kwargs = kwargs - return self.build_email_real(*args, **kwargs) +class test_message_compose(test_mail.TestMailMockups): def setUp(self): super(test_message_compose, self).setUp() @@ -40,11 +33,6 @@ class test_message_compose(common.TransactionCase): self.res_users = self.registry('res.users') self.res_partner = self.registry('res.partner') - # Install mock SMTP gateway - self.build_email_real = self.registry('ir.mail_server').build_email - self.registry('ir.mail_server').build_email = self._mock_build_email - self.registry('ir.mail_server').send_email = self._mock_smtp_gateway - # create a 'pigs' and 'bird' groups that will be used through the various tests self.group_pigs_id = self.mail_group.create(self.cr, self.uid, {'name': 'Pigs', 'description': 'Fans of Pigs, unite !'}) diff --git a/addons/portal/tests/test_portal.py b/addons/portal/tests/test_portal.py index 5f2875711df..1f709ed3fa9 100644 --- a/addons/portal/tests/test_portal.py +++ b/addons/portal/tests/test_portal.py @@ -20,7 +20,6 @@ ############################################################################## from openerp.addons.mail.tests import test_mail -# from openerp.tests import common from openerp.tools import append_content_to_html