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
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
Hardik Juneja
erp5
Commits
6bb1db0b
Commit
6bb1db0b
authored
Oct 26, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item: add missing tests for Item_getTrackingList
parent
501ec778
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
product/ERP5/tests/testItem.py
product/ERP5/tests/testItem.py
+25
-2
No files found.
product/ERP5/tests/testItem.py
View file @
6bb1db0b
...
...
@@ -1033,7 +1033,9 @@ class TestItemScripts(ERP5TypeTestCase):
self
.
tic
()
@
reindex
def
_makeSalePackingListLine
(
self
):
def
_makeSalePackingListLine
(
self
,
start_date
=
None
):
if
start_date
is
None
:
start_date
=
DateTime
()
-
1
packing_list
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
,
source_value
=
self
.
mirror_node
,
...
...
@@ -1041,7 +1043,7 @@ class TestItemScripts(ERP5TypeTestCase):
destination_value
=
self
.
node
,
destination_section_value
=
self
.
section
,
specialise_value
=
self
.
portal
.
business_process_module
.
erp5_default_business_process
,
start_date
=
DateTime
()
-
1
,)
start_date
=
start_date
,)
line
=
packing_list
.
newContent
(
portal_type
=
'Sale Packing List Line'
,
quantity
=
1
,
...
...
@@ -1095,6 +1097,27 @@ class TestItemScripts(ERP5TypeTestCase):
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentSiteTitle
(
at_date
=
DateTime
()
-
2
))
def
test_Item_getTrackingList_empty
(
self
):
self
.
assertEqual
([],
self
.
item
.
Item_getTrackingList
())
def
test_Item_getTrackingList_explanation_brain_attribute
(
self
):
line
=
self
.
_makeSalePackingListLine
(
start_date
=
DateTime
(
2001
,
2
,
3
))
line
.
setTitle
(
'explanation title'
)
self
.
tic
()
history_item
,
=
self
.
item
.
Item_getTrackingList
()
self
.
assertEqual
(
DateTime
(
2001
,
2
,
3
),
history_item
.
date
)
self
.
assertEqual
(
'Node'
,
history_item
.
node_title
)
self
.
assertEqual
(
'Mirror Node'
,
history_item
.
source_title
)
self
.
assertEqual
(
'Section'
,
history_item
.
section_title
)
self
.
assertEqual
(
'Product'
,
history_item
.
resource_title
)
self
.
assertEqual
(
'explanation title'
,
history_item
.
explanation
)
self
.
assertEqual
(
'Sale Packing List Line'
,
history_item
.
translated_portal_type
)
self
.
assertEqual
(
1
,
history_item
.
quantity
)
self
.
assertEqual
(
line
.
absolute_url
(),
history_item
.
url
)
self
.
assertEqual
((),
history_item
.
variation_category_item_list
)
self
.
assertEqual
(
'Delivered'
,
history_item
.
simulation_state
)
def
test_item_current_location_and_transit_movement
(
self
):
# a started packing list is still in transit, so we do not know its
# current location until it is delivered.
...
...
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