Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
3b0a2828
Commit
3b0a2828
authored
5 years ago
by
Yannick Tivisse
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] delivery: Avoid multi-executed tests
parent
bae2d9f7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addons/delivery/tests/test_packing_delivery.py
+17
-13
17 additions, 13 deletions
addons/delivery/tests/test_packing_delivery.py
addons/stock/tests/test_packing.py
+6
-2
6 additions, 2 deletions
addons/stock/tests/test_packing.py
with
23 additions
and
15 deletions
addons/delivery/tests/test_packing_delivery.py
+
17
−
13
View file @
3b0a2828
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
,
...
...
This diff is collapsed.
Click to expand it.
addons/stock/tests/test_packing.py
+
6
−
2
View file @
3b0a2828
...
...
@@ -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
(
TestPacking
Common
,
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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment