Skip to content
Snippets Groups Projects
Commit 3b0a2828 authored by Yannick Tivisse's avatar Yannick Tivisse
Browse files

[IMP] delivery: Avoid multi-executed tests

parent bae2d9f7
No related branches found
No related tags found
No related merge requests found
from odoo.addons.stock.tests.test_packing import TestPacking
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.stock.tests.test_packing import TestPackingCommon
class TestPacking(TestPacking):
def setUp(self):
super(TestPacking, self).setUp()
self.uom_kg = self.env.ref('uom.product_uom_kgm')
self.product_aw = self.env['product.product'].create({
class TestPacking(TestPackingCommon):
@classmethod
def setUpClass(cls):
super(TestPacking, cls).setUpClass()
cls.uom_kg = cls.env.ref('uom.product_uom_kgm')
cls.product_aw = cls.env['product.product'].create({
'name': 'Product AW',
'type': 'product',
'weight': 2.4,
'uom_id': self.uom_kg.id,
'uom_po_id': self.uom_kg.id
'uom_id': cls.uom_kg.id,
'uom_po_id': cls.uom_kg.id
})
self.product_bw = self.env['product.product'].create({
cls.product_bw = cls.env['product.product'].create({
'name': 'Product BW',
'type': 'product',
'weight': 0.3,
'uom_id': self.uom_kg.id,
'uom_po_id': self.uom_kg.id
'uom_id': cls.uom_kg.id,
'uom_po_id': cls.uom_kg.id
})
test_carrier_product = self.env['product.product'].create({
test_carrier_product = cls.env['product.product'].create({
'name': 'Test carrier product',
'type': 'service',
})
self.test_carrier = self.env['delivery.carrier'].create({
cls.test_carrier = cls.env['delivery.carrier'].create({
'name': 'Test carrier',
'delivery_type': 'fixed',
'product_id': test_carrier_product.id,
......
......@@ -5,10 +5,11 @@ from odoo.tests.common import SavepointCase
from odoo.tools import float_round
class TestPacking(SavepointCase):
class TestPackingCommon(SavepointCase):
@classmethod
def setUpClass(cls):
super(TestPacking, cls).setUpClass()
super(TestPackingCommon, cls).setUpClass()
cls.stock_location = cls.env.ref('stock.stock_location_stock')
cls.warehouse = cls.env['stock.warehouse'].search([('lot_stock_id', '=', cls.stock_location.id)], limit=1)
cls.warehouse.write({'delivery_steps': 'pick_pack_ship'})
......@@ -19,6 +20,9 @@ class TestPacking(SavepointCase):
cls.productA = cls.env['product.product'].create({'name': 'Product A', 'type': 'product'})
cls.productB = cls.env['product.product'].create({'name': 'Product B', 'type': 'product'})
class TestPacking(TestPackingCommon):
def test_put_in_pack(self):
""" In a pick pack ship scenario, create two packs in pick and check that
they are correctly recognised and handled by the pack and ship picking.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment