diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/website_sale/tests/test_website_sale_mail.py | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/website_sale/tests/test_website_sale_mail.py')
| -rw-r--r-- | addons/website_sale/tests/test_website_sale_mail.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/addons/website_sale/tests/test_website_sale_mail.py b/addons/website_sale/tests/test_website_sale_mail.py new file mode 100644 index 00000000..4962dd0d --- /dev/null +++ b/addons/website_sale/tests/test_website_sale_mail.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from unittest.mock import patch + +import odoo +from odoo.tests import tagged +from odoo.tests.common import HttpCase + + +@tagged('post_install', '-at_install') +class TestWebsiteSaleMail(HttpCase): + + def test_01_shop_mail_tour(self): + """The goal of this test is to make sure sending SO by email works.""" + + self.env['product.product'].create({ + 'name': 'Acoustic Bloc Screens', + 'list_price': 2950.0, + 'website_published': True, + }) + self.env['res.partner'].create({ + 'name': 'Azure Interior', + 'email': 'azure.Interior24@example.com', + }) + + # we override unlink because we don't want the email to be auto deleted + MailMail = odoo.addons.mail.models.mail_mail.MailMail + + with patch.object(MailMail, 'unlink', lambda self: None): + self.start_tour("/", 'shop_mail', login="admin") |
