Merge lp:~openerp-dev/openobject-addons/7.0-opw-603100-rgo into lp:openobject-addons/7.0

Proposed by Anaël Closson (openerp)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-603100-rgo
Merge into: lp:openobject-addons/7.0
Diff against target: 122 lines (+12/-12)
5 files modified
email_template/tests/test_mail.py (+1/-1)
mail/tests/test_invite.py (+1/-1)
mail/tests/test_mail_base.py (+2/-2)
mail/tests/test_mail_features.py (+5/-5)
portal/tests/test_portal.py (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-603100-rgo
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+209015@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

9860. By Ravi Gohil (OpenERP)

[FIX] Fixed translation issues(which leads the test cases to fail) for the unittests which is faced when installing/updating the mail module with default lang other than English set in OE server config file. (Maintenance Case: 603100)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'email_template/tests/test_mail.py'
--- email_template/tests/test_mail.py 2014-01-14 13:46:27 +0000
+++ email_template/tests/test_mail.py 2014-03-03 09:17:35 +0000
@@ -204,7 +204,7 @@
204 @mute_logger('openerp.osv.orm', 'openerp.osv.orm')204 @mute_logger('openerp.osv.orm', 'openerp.osv.orm')
205 def test_10_email_templating(self):205 def test_10_email_templating(self):
206 """ Tests designed for the mail.compose.message wizard updated by email_template. """206 """ Tests designed for the mail.compose.message wizard updated by email_template. """
207 cr, uid, context = self.cr, self.uid, {}207 cr, uid, context = self.cr, self.uid, {'lang': 'en_US'}
208208
209 # create the email.template on mail.group model209 # create the email.template on mail.group model
210 group_model_id = self.registry('ir.model').search(cr, uid, [('model', '=', 'mail.group')])[0]210 group_model_id = self.registry('ir.model').search(cr, uid, [('model', '=', 'mail.group')])[0]
211211
=== modified file 'mail/tests/test_invite.py'
--- mail/tests/test_invite.py 2012-12-12 10:42:20 +0000
+++ mail/tests/test_invite.py 2014-03-03 09:17:35 +0000
@@ -30,7 +30,7 @@
3030
31 # Do: create a mail_wizard_invite, validate it31 # Do: create a mail_wizard_invite, validate it
32 self._init_mock_build_email()32 self._init_mock_build_email()
33 context = {'default_res_model': 'mail.group', 'default_res_id': self.group_pigs_id}33 context = {'default_res_model': 'mail.group', 'default_res_id': self.group_pigs_id, 'lang': 'en_US'}
34 mail_invite_id = mail_invite.create(cr, self.user_raoul_id, {'partner_ids': [(4, self.partner_bert_id)]}, context)34 mail_invite_id = mail_invite.create(cr, self.user_raoul_id, {'partner_ids': [(4, self.partner_bert_id)]}, context)
35 mail_invite.add_followers(cr, self.user_raoul_id, [mail_invite_id], {'default_model': 'mail.group', 'default_res_id': 0})35 mail_invite.add_followers(cr, self.user_raoul_id, [mail_invite_id], {'default_model': 'mail.group', 'default_res_id': 0})
3636
3737
=== modified file 'mail/tests/test_mail_base.py'
--- mail/tests/test_mail_base.py 2013-03-20 11:41:11 +0000
+++ mail/tests/test_mail_base.py 2014-03-03 09:17:35 +0000
@@ -40,7 +40,7 @@
4040
41 def setUp(self):41 def setUp(self):
42 super(TestMailBase, self).setUp()42 super(TestMailBase, self).setUp()
43 cr, uid = self.cr, self.uid43 cr, uid, context = self.cr, self.uid, {'lang': 'en_US'}
4444
45 # Install mock SMTP gateway45 # Install mock SMTP gateway
46 self._init_mock_build_email()46 self._init_mock_build_email()
@@ -84,7 +84,7 @@
84 self.group_pigs_id = self.mail_group.create(cr, uid,84 self.group_pigs_id = self.mail_group.create(cr, uid,
85 {'name': 'Pigs', 'description': 'Fans of Pigs, unite !'},85 {'name': 'Pigs', 'description': 'Fans of Pigs, unite !'},
86 {'mail_create_nolog': True})86 {'mail_create_nolog': True})
87 self.group_pigs = self.mail_group.browse(cr, uid, self.group_pigs_id)87 self.group_pigs = self.mail_group.browse(cr, uid, self.group_pigs_id, context)
8888
89 def tearDown(self):89 def tearDown(self):
90 # Remove mocks90 # Remove mocks
9191
=== modified file 'mail/tests/test_mail_features.py'
--- mail/tests/test_mail_features.py 2013-08-23 12:06:11 +0000
+++ mail/tests/test_mail_features.py 2014-03-03 09:17:35 +0000
@@ -228,7 +228,7 @@
228228
229 def test_20_message_post(self):229 def test_20_message_post(self):
230 """ Tests designed for message_post. """230 """ Tests designed for message_post. """
231 cr, uid, user_raoul, group_pigs = self.cr, self.uid, self.user_raoul, self.group_pigs231 cr, uid, user_raoul, group_pigs, context = self.cr, self.uid, self.user_raoul, self.group_pigs, {'lang': 'en_US'}
232232
233 # --------------------------------------------------233 # --------------------------------------------------
234 # Data creation234 # Data creation
@@ -288,7 +288,7 @@
288 msg1_id = self.mail_group.message_post(cr, user_raoul.id, self.group_pigs_id,288 msg1_id = self.mail_group.message_post(cr, user_raoul.id, self.group_pigs_id,
289 body=_body1, subject=_subject, partner_ids=[p_b_id, p_c_id],289 body=_body1, subject=_subject, partner_ids=[p_b_id, p_c_id],
290 attachment_ids=[attach1_id, attach2_id], attachments=_attachments,290 attachment_ids=[attach1_id, attach2_id], attachments=_attachments,
291 type='comment', subtype='mt_comment')291 type='comment', subtype='mt_comment', context=context)
292 msg = self.mail_message.browse(cr, uid, msg1_id)292 msg = self.mail_message.browse(cr, uid, msg1_id)
293 msg_message_id = msg.message_id293 msg_message_id = msg.message_id
294 msg_pids = [partner.id for partner in msg.notified_partner_ids]294 msg_pids = [partner.id for partner in msg.notified_partner_ids]
@@ -387,7 +387,7 @@
387 msg2_id = self.mail_group.message_post(cr, user_raoul.id, self.group_pigs_id,387 msg2_id = self.mail_group.message_post(cr, user_raoul.id, self.group_pigs_id,
388 body=_body2, type='email', subtype='mt_comment',388 body=_body2, type='email', subtype='mt_comment',
389 partner_ids=[p_d_id], parent_id=msg1_id, attachment_ids=[attach3_id],389 partner_ids=[p_d_id], parent_id=msg1_id, attachment_ids=[attach3_id],
390 context={'mail_post_autofollow': True})390 context=dict(context, mail_post_autofollow=True))
391 msg = self.mail_message.browse(cr, uid, msg2_id)391 msg = self.mail_message.browse(cr, uid, msg2_id)
392 msg_pids = [partner.id for partner in msg.notified_partner_ids]392 msg_pids = [partner.id for partner in msg.notified_partner_ids]
393 msg_aids = [attach.id for attach in msg.attachment_ids]393 msg_aids = [attach.id for attach in msg.attachment_ids]
@@ -667,7 +667,7 @@
667 return body.replace(' ', '').replace('\n', '')667 return body.replace(' ', '').replace('\n', '')
668668
669 # Data: subscribe Raoul to Pigs, because he will change the public attribute and may loose access to the record669 # Data: subscribe Raoul to Pigs, because he will change the public attribute and may loose access to the record
670 cr, uid = self.cr, self.uid670 cr, uid, context = self.cr, self.uid, {'lang': 'en_US'}
671 self.mail_group.message_subscribe_users(cr, uid, [self.group_pigs_id], [self.user_raoul_id])671 self.mail_group.message_subscribe_users(cr, uid, [self.group_pigs_id], [self.user_raoul_id])
672672
673 # Data: res.users.group, to test group_public_id automatic logging673 # Data: res.users.group, to test group_public_id automatic logging
@@ -728,7 +728,7 @@
728 self.assertIn(u'Pigs\u2192supername', _strip_string_spaces(last_msg.body), 'tracked feature: message body does not hold always tracked field')728 self.assertIn(u'Pigs\u2192supername', _strip_string_spaces(last_msg.body), 'tracked feature: message body does not hold always tracked field')
729729
730 # Test: change public as public, group_public_id -> 1 subtype, name always tracked730 # Test: change public as public, group_public_id -> 1 subtype, name always tracked
731 self.mail_group.write(cr, self.user_raoul_id, [self.group_pigs_id], {'public': 'public', 'group_public_id': group_system_id})731 self.mail_group.write(cr, self.user_raoul_id, [self.group_pigs_id], {'public': 'public', 'group_public_id': group_system_id}, context)
732 self.group_pigs.refresh()732 self.group_pigs.refresh()
733 self.assertEqual(len(self.group_pigs.message_ids), 4, 'tracked: one message should have been produced')733 self.assertEqual(len(self.group_pigs.message_ids), 4, 'tracked: one message should have been produced')
734 # Test: first produced message: mt_group_public_id, with name always tracked, public tracked on change734 # Test: first produced message: mt_group_public_id, with name always tracked, public tracked on change
735735
=== modified file 'portal/tests/test_portal.py'
--- portal/tests/test_portal.py 2013-11-19 17:56:58 +0000
+++ portal/tests/test_portal.py 2014-03-03 09:17:35 +0000
@@ -110,7 +110,7 @@
110110
111 # Do: create a mail_wizard_invite, validate it111 # Do: create a mail_wizard_invite, validate it
112 self._init_mock_build_email()112 self._init_mock_build_email()
113 context = {'default_res_model': 'mail.group', 'default_res_id': self.group_pigs_id}113 context = {'default_res_model': 'mail.group', 'default_res_id': self.group_pigs_id, 'lang': 'en_US'}
114 mail_invite_id = mail_invite.create(cr, uid, {'partner_ids': [(4, partner_carine_id)]}, context)114 mail_invite_id = mail_invite.create(cr, uid, {'partner_ids': [(4, partner_carine_id)]}, context)
115 mail_invite.add_followers(cr, uid, [mail_invite_id])115 mail_invite.add_followers(cr, uid, [mail_invite_id])
116116
@@ -137,10 +137,10 @@
137 'body of invitation email does not contain signup url')137 'body of invitation email does not contain signup url')
138138
139 def test_20_message_read(self):139 def test_20_message_read(self):
140 cr, uid, group_port_id = self.cr, self.uid, self.group_port_id140 cr, uid, group_port_id, context = self.cr, self.uid, self.group_port_id, {'lang': 'en_US'}
141141
142 # Data: custom subtypes142 # Data: custom subtypes
143 mt_group_public_id = self.mail_message_subtype.create(cr, uid, {'name': 'group_public', 'description': 'Group changed'})143 mt_group_public_id = self.mail_message_subtype.create(cr, uid, {'name': 'group_public', 'description': 'Group changed'}, context)
144 self.ir_model_data.create(cr, uid, {'name': 'mt_group_public', 'model': 'mail.message.subtype', 'module': 'mail', 'res_id': mt_group_public_id})144 self.ir_model_data.create(cr, uid, {'name': 'mt_group_public', 'model': 'mail.message.subtype', 'module': 'mail', 'res_id': mt_group_public_id})
145 # Data: post messages with various subtypes145 # Data: post messages with various subtypes
146 msg1_id = self.mail_group.message_post(cr, uid, group_port_id, body='Body1', type='comment', subtype='mail.mt_comment')146 msg1_id = self.mail_group.message_post(cr, uid, group_port_id, body='Body1', type='comment', subtype='mail.mt_comment')