From a3de5c872f7c26ec085dc62b95cfc62382ab970a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 9 Apr 2013 13:11:58 +0200 Subject: [REF] [IMP] mail_alias improvement alias_name is not required anymore crm, hr_job, project, mail_group, res_users: alias creation is now different and done more like other inherits, except an alias_model_name that is given to the context to find the alias alias_model_id. crm, jr_job, project, mail_group, res_users: updated form views using aliases mail_alias: added a filter on 'inactive' aliases (alias_name False) and added a button to redirect to the related document if any bzr revid: tde@openerp.com-20130409111158-bv04n5o01z9l3c17 --- addons/mail/tests/test_mail_features.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'addons/mail/tests/test_mail_features.py') diff --git a/addons/mail/tests/test_mail_features.py b/addons/mail/tests/test_mail_features.py index 7eea66b3b90..f23440d8af4 100644 --- a/addons/mail/tests/test_mail_features.py +++ b/addons/mail/tests/test_mail_features.py @@ -24,26 +24,25 @@ from openerp.tools.mail import html_sanitize class test_mail(TestMailBase): - + def test_000_alias_setup(self): """ Test basic mail.alias setup works, before trying to use them for routing """ cr, uid = self.cr, self.uid self.user_valentin_id = self.res_users.create(cr, uid, - {'name': 'Valentin Cognito', 'email': 'valentin.cognito@gmail.com', 'login': 'valentin.cognito'}) + {'name': 'Valentin Cognito', 'email': 'valentin.cognito@gmail.com', 'login': 'valentin.cognito', 'alias_name': 'valentin.cognito'}) self.user_valentin = self.res_users.browse(cr, uid, self.user_valentin_id) self.assertEquals(self.user_valentin.alias_name, self.user_valentin.login, "Login should be used as alias") self.user_pagan_id = self.res_users.create(cr, uid, - {'name': 'Pagan Le Marchant', 'email': 'plmarchant@gmail.com', 'login': 'plmarchant@gmail.com'}) + {'name': 'Pagan Le Marchant', 'email': 'plmarchant@gmail.com', 'login': 'plmarchant@gmail.com', 'alias_name': 'plmarchant@gmail.com'}) self.user_pagan = self.res_users.browse(cr, uid, self.user_pagan_id) self.assertEquals(self.user_pagan.alias_name, 'plmarchant', "If login is an email, the alias should keep only the local part") self.user_barty_id = self.res_users.create(cr, uid, - {'name': 'Bartholomew Ironside', 'email': 'barty@gmail.com', 'login': 'b4r+_#_R3wl$$'}) + {'name': 'Bartholomew Ironside', 'email': 'barty@gmail.com', 'login': 'b4r+_#_R3wl$$', 'alias_name': 'b4r+_#_R3wl$$'}) self.user_barty = self.res_users.browse(cr, uid, self.user_barty_id) self.assertEquals(self.user_barty.alias_name, 'b4r+_-_r3wl-', 'Disallowed chars should be replaced by hyphens') - def test_00_followers_function_field(self): """ Tests designed for the many2many function field 'follower_ids'. We will test to perform writes using the many2many commands 0, 3, 4, -- cgit v1.2.3