Debian Codegraph @

addons/website_sale_collect/tests/test_product_template.py

raw symbols SCIP
1 # Part of Odoo. See LICENSE file for full copyright and licensing details.
2
3 from datetime import datetime
4
5 from odoo.tests import tagged
6
7 from odoo.addons.website_sale.tests.common import MockRequest
8 from odoo.addons.website_sale_collect.tests.common import ClickAndCollectCommon
9
10
11 @tagged('post_install', '-at_install')
12 class TestProductTemplate(ClickAndCollectCommon):
13
14 def test_out_of_stock_product_available_when_allow_continue_selling(self):
15 product = self._create_product(allow_out_of_stock_order=True)
16 self.free_delivery.is_published = True
17 with MockRequest(self.env, website=self.website, sale_order_id=self.cart.id):
18 comb_info = self.env['product.template']._get_additionnal_combination_info(
19 product,
20 quantity=1,
21 date=datetime(2000, 1, 1),
22 uom=self.uom_unit,
23 website=self.website,
24 )
25 self.assertTrue(comb_info['delivery_stock_data']['in_stock'])
26 self.assertTrue(comb_info['in_store_stock_data']['in_stock'])