Purpose of this commit is to regroup some tests, or rename some too specific files in order to avoid explosion of files, making tests hard to find when looking for feature-specific tests. Task-3346388 Part-of: odoo/odoo#123678
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.addons.mail.tests.common import MailCommon
|
|
from odoo.tests import users
|
|
|
|
|
|
class TestNotifySecurityUpdate(MailCommon):
|
|
|
|
@users('employee')
|
|
def test_security_update_email(self):
|
|
""" User should be notified on old email address when the email changes """
|
|
with self.mock_mail_gateway():
|
|
self.env.user.write({'email': 'new@example.com'})
|
|
|
|
self.assertMailMailWEmails(['e.e@example.com'], 'outgoing', fields_values={
|
|
'subject': 'Security Update: Email Changed',
|
|
})
|
|
|
|
@users('employee')
|
|
def test_security_update_login(self):
|
|
with self.mock_mail_gateway():
|
|
self.env.user.write({'login': 'newlogin'})
|
|
|
|
self.assertMailMailWEmails([self.env.user.email_formatted], 'outgoing', fields_values={
|
|
'subject': 'Security Update: Login Changed',
|
|
})
|
|
|
|
@users('employee')
|
|
def test_security_update_password(self):
|
|
with self.mock_mail_gateway():
|
|
self.env.user.write({'password': 'newpassword'})
|
|
|
|
self.assertMailMailWEmails([self.env.user.email_formatted], 'outgoing', fields_values={
|
|
'subject': 'Security Update: Password Changed',
|
|
})
|