Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amrani
erp5
Commits
08c3be51
Commit
08c3be51
authored
Nov 18, 2013
by
Mame Coumba Sall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify test to include section_uid everytime getInventory is called
parent
826db5f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+15
-13
No files found.
product/ERP5/tests/testInventoryAPI.py
View file @
08c3be51
...
@@ -516,13 +516,15 @@ class TestInventory(InventoryAPITestCase):
...
@@ -516,13 +516,15 @@ class TestInventory(InventoryAPITestCase):
self
.
resource
.
setProductLine
(
'level1/level2'
)
self
.
resource
.
setProductLine
(
'level1/level2'
)
self
.
_makeMovement
(
quantity
=
100
,
source_value
=
None
)
self
.
_makeMovement
(
quantity
=
100
,
source_value
=
None
)
self
.
assertInventoryEquals
(
100
,
resource_category
=
'product_line/level1'
)
self
.
assertInventoryEquals
(
100
,
section_uid
=
self
.
section
.
getUid
(),
self
.
assertInventoryEquals
(
100
,
resource_category
=
'product_line/level1/level2'
)
resource_category
=
'product_line/level1'
)
self
.
assertInventoryEquals
(
0
,
self
.
assertInventoryEquals
(
100
,
section_uid
=
self
.
section
.
getUid
(),
resource_category
=
'product_line/level1/level2'
)
self
.
assertInventoryEquals
(
0
,
section_uid
=
self
.
section
.
getUid
(),
resource_category_strict_membership
=
[
'product_line/level1'
])
resource_category_strict_membership
=
[
'product_line/level1'
])
self
.
resource
.
setProductLine
(
'level1'
)
self
.
resource
.
setProductLine
(
'level1'
)
self
.
tic
()
self
.
tic
()
self
.
assertInventoryEquals
(
100
,
self
.
assertInventoryEquals
(
100
,
section_uid
=
self
.
section
.
getUid
(),
resource_category_strict_membership
=
[
'product_line/level1'
])
resource_category_strict_membership
=
[
'product_line/level1'
])
def
test_ResourcePortalType
(
self
):
def
test_ResourcePortalType
(
self
):
...
@@ -532,9 +534,9 @@ class TestInventory(InventoryAPITestCase):
...
@@ -532,9 +534,9 @@ class TestInventory(InventoryAPITestCase):
source_value
=
None
,
source_value
=
None
,
resource_value
=
self
.
portal
.
portal_categories
.
product_line
.
level1
)
resource_value
=
self
.
portal
.
portal_categories
.
product_line
.
level1
)
assert
self
.
resource
.
portal_type
!=
'Category'
assert
self
.
resource
.
portal_type
!=
'Category'
self
.
assertInventoryEquals
(
2
,
self
.
assertInventoryEquals
(
2
,
section_uid
=
self
.
section
.
getUid
(),
resource_portal_type
=
self
.
resource
.
portal_type
)
resource_portal_type
=
self
.
resource
.
portal_type
)
self
.
assertInventoryEquals
(
3
,
self
.
assertInventoryEquals
(
3
,
section_uid
=
self
.
section
.
getUid
(),
resource_portal_type
=
'Category'
)
resource_portal_type
=
'Category'
)
# FIXME: resource_portal_type is an automatically generated related key,
# FIXME: resource_portal_type is an automatically generated related key,
# but as movements categories are not cataloged with acquisition, it does
# but as movements categories are not cataloged with acquisition, it does
...
@@ -598,10 +600,10 @@ class TestInventory(InventoryAPITestCase):
...
@@ -598,10 +600,10 @@ class TestInventory(InventoryAPITestCase):
simulation_state
=
'confirmed'
,
simulation_state
=
'confirmed'
,
source_value
=
None
)
source_value
=
None
)
self
.
assertInventoryEquals
(
100
)
self
.
assertInventoryEquals
(
100
,
section_uid
=
self
.
section
.
getUid
()
)
self
.
assertInventoryEquals
(
100
,
simulation_state
=
'confirmed'
)
self
.
assertInventoryEquals
(
100
,
s
ection_uid
=
self
.
section
.
getUid
(),
s
imulation_state
=
'confirmed'
)
self
.
assertInventoryEquals
(
0
,
simulation_state
=
'planned'
)
self
.
assertInventoryEquals
(
0
,
s
ection_uid
=
self
.
section
.
getUid
(),
s
imulation_state
=
'planned'
)
self
.
assertInventoryEquals
(
100
,
simulation_state
=
[
'planned'
,
'confirmed'
])
self
.
assertInventoryEquals
(
100
,
s
ection_uid
=
self
.
section
.
getUid
(),
s
imulation_state
=
[
'planned'
,
'confirmed'
])
def
test_MultipleNodes
(
self
):
def
test_MultipleNodes
(
self
):
"""Test section category with many nodes. """
"""Test section category with many nodes. """
...
@@ -831,9 +833,9 @@ class TestInventoryList(InventoryAPITestCase):
...
@@ -831,9 +833,9 @@ class TestInventoryList(InventoryAPITestCase):
def
test_GroupByNode
(
self
):
def
test_GroupByNode
(
self
):
getInventoryList
=
self
.
getSimulationTool
().
getInventoryList
getInventoryList
=
self
.
getSimulationTool
().
getInventoryList
self
.
_makeMovement
(
quantity
=
100
)
self
.
_makeMovement
(
quantity
=
100
)
self
.
_makeMovement
(
destination_value
=
self
.
other_node
,
quantity
=
100
)
self
.
_makeMovement
(
destination_value
=
self
.
other_node
,
source_value
=
self
.
mirror_node
,
quantity
=
100
)
self
.
_makeMovement
(
destination_value
=
None
,
quantity
=
100
)
self
.
_makeMovement
(
destination_value
=
None
,
source_value
=
self
.
mirror_node
,
quantity
=
100
)
inventory_list
=
getInventoryList
(
group_by_node
=
1
)
inventory_list
=
getInventoryList
(
section_uid
=
self
.
section
.
getUid
(),
group_by_node
=
1
)
self
.
assertEquals
(
3
,
len
(
inventory_list
))
self
.
assertEquals
(
3
,
len
(
inventory_list
))
self
.
assertEquals
([
r
for
r
in
inventory_list
if
r
.
node_relative_url
==
self
.
assertEquals
([
r
for
r
in
inventory_list
if
r
.
node_relative_url
==
self
.
node
.
getRelativeUrl
()][
0
].
inventory
,
100
)
self
.
node
.
getRelativeUrl
()][
0
].
inventory
,
100
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment