Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
5251d99a
Commit
5251d99a
authored
May 18, 2012
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resource_category parameter does not work when full inventory exist. This is a test for the bug.
parent
c8ea5222
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+62
-0
No files found.
product/ERP5/tests/testInventoryAPI.py
View file @
5251d99a
...
@@ -167,6 +167,7 @@ class InventoryAPITestCase(ERP5TypeTestCase):
...
@@ -167,6 +167,7 @@ class InventoryAPITestCase(ERP5TypeTestCase):
'group/level1/level2'
,
'group/level1/level2'
,
'group/anotherlevel'
,
'group/anotherlevel'
,
'product_line/level1/level2'
,
'product_line/level1/level2'
,
'product_line/anotherlevel'
,
'use/use1'
,
'use/use1'
,
'use/use2'
,
'use/use2'
,
'function/function1'
,
'function/function1'
,
...
@@ -453,6 +454,67 @@ class TestInventory(InventoryAPITestCase):
...
@@ -453,6 +454,67 @@ class TestInventory(InventoryAPITestCase):
self
.
assertInventoryEquals
(
100
,
self
.
assertInventoryEquals
(
100
,
resource_category_strict_membership
=
[
'product_line/level1'
])
resource_category_strict_membership
=
[
'product_line/level1'
])
def
test_ResourceCategoryWithFullInventory
(
self
):
"""Make sure that resource category works when full inventory exists."""
self
.
resource
.
setProductLine
(
'level1/level2'
)
self
.
other_resource
.
setProductLine
(
'anotherlevel'
)
full_inventory1
=
self
.
portal
.
inventory_module
.
newContent
(
portal_type
=
'Inventory'
)
full_inventory1
.
edit
(
destination_section_value
=
self
.
section
,
destination_value
=
self
.
node
,
full_inventory
=
1
,
start_date
=
DateTime
(
'2012/05/18 00:00:00 GMT+9'
))
line11
=
full_inventory1
.
newContent
(
portal_type
=
'Inventory Line'
)
line11
.
setResourceValue
(
self
.
resource
)
line11
.
setQuantity
(
17
)
line12
=
full_inventory1
.
newContent
(
portal_type
=
'Inventory Line'
)
line12
.
setResourceValue
(
self
.
other_resource
)
line12
.
setQuantity
(
13
)
full_inventory1
.
deliver
()
self
.
commit
()
self
.
tic
()
self
.
assertInventoryEquals
(
17
,
resource_uid
=
self
.
resource
.
getUid
()
)
self
.
assertInventoryEquals
(
13
,
resource_uid
=
self
.
other_resource
.
getUid
()
)
self
.
assertInventoryEquals
(
17
,
section_uid
=
self
.
section
.
getUid
(),
node_uid
=
self
.
node
.
getUid
(),
resource_uid
=
self
.
resource
.
getUid
()
)
self
.
assertInventoryEquals
(
13
,
section_uid
=
self
.
section
.
getUid
(),
node_uid
=
self
.
node
.
getUid
(),
resource_uid
=
self
.
other_resource
.
getUid
()
)
self
.
assertInventoryEquals
(
17
,
resource_category
=
'product_line/level1'
)
self
.
assertInventoryEquals
(
13
,
resource_category
=
'product_line/anotherlevel'
)
# In reality this is not an expected failure, I will remove this very soon.(Yusei)
self
.
expectedFailure
(
assertInventoryEquals
)(
17
,
section_uid
=
self
.
section
.
getUid
(),
node_uid
=
self
.
node
.
getUid
(),
resource_category
=
'product_line/level1'
)
self
.
assertInventoryEquals
(
13
,
section_uid
=
self
.
section
.
getUid
(),
node_uid
=
self
.
node
.
getUid
(),
resource_category
=
'product_line/anotherlevel'
)
def
test_PaymentCategory
(
self
):
def
test_PaymentCategory
(
self
):
"""Tests inventory on payment_category """
"""Tests inventory on payment_category """
# for now, BankAccount have a product_line category, so we can use this for
# for now, BankAccount have a product_line category, so we can use this for
...
...
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