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
Eugene Shen
erp5
Commits
cb083056
Commit
cb083056
authored
Apr 05, 2013
by
Tatuya Kamada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit Test: Add a test for Property Grouping Movement Group.
parent
9fda5829
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
product/ERP5/tests/testMovementGroup.py
product/ERP5/tests/testMovementGroup.py
+76
-0
No files found.
product/ERP5/tests/testMovementGroup.py
View file @
cb083056
...
@@ -449,6 +449,81 @@ class TestMovementGroupCommonAPI(MovementGroupTestCase):
...
@@ -449,6 +449,81 @@ class TestMovementGroupCommonAPI(MovementGroupTestCase):
instance
=
class_
(
'dummy'
)
instance
=
class_
(
'dummy'
)
self
.
assertEqual
(
instance
.
_separate
([]),
[])
self
.
assertEqual
(
instance
.
_separate
([]),
[])
class
TestPropertyGroupingMovementGroup
(
MovementGroupTestCase
):
def
test_property_movement_group_grouping
(
self
):
movement_list
=
(
self
.
folder
.
newContent
(
temp_object
=
1
,
portal_type
=
'Simulation Movement'
,
start_date
=
DateTime
(
2001
,
1
,
1
)),
self
.
folder
.
newContent
(
temp_object
=
1
,
portal_type
=
'Simulation Movement'
,
start_date
=
DateTime
(
2001
,
1
,
1
)))
self
.
builder
.
newContent
(
portal_type
=
'Property Grouping Movement Group'
,
collect_order_group
=
'delivery'
,
tested_property_list
=
(
'start_date'
,))
movement_group_node
=
self
.
builder
.
collectMovement
(
movement_list
)
group_list
=
movement_group_node
.
getGroupList
()
self
.
assertEquals
(
1
,
len
(
group_list
))
# This movent group must not assign the properties
self
.
assertEquals
({},
group_list
[
0
].
getGroupEditDict
())
def
test_property_movement_group_separating
(
self
):
movement_list
=
(
self
.
folder
.
newContent
(
temp_object
=
1
,
portal_type
=
'Simulation Movement'
,
start_date
=
DateTime
(
2001
,
1
,
1
)),
self
.
folder
.
newContent
(
temp_object
=
1
,
portal_type
=
'Simulation Movement'
,
start_date
=
DateTime
(
2001
,
1
,
2
)))
self
.
builder
.
newContent
(
portal_type
=
'Property Grouping Movement Group'
,
collect_order_group
=
'delivery'
,
tested_property_list
=
(
'start_date'
,))
movement_group_node
=
self
.
builder
.
collectMovement
(
movement_list
)
group_list
=
movement_group_node
.
getGroupList
()
self
.
assertEquals
(
2
,
len
(
group_list
))
for
group
in
group_list
:
# This movent group must not assign the properties
self
.
assertEquals
({},
group
.
getGroupEditDict
())
def
test_property_movement_group_and_separating
(
self
):
movement_list
=
(
self
.
folder
.
newContent
(
temp_object
=
1
,
portal_type
=
'Simulation Movement'
,
title
=
'B'
,
start_date
=
DateTime
(
2001
,
1
,
1
)),
self
.
folder
.
newContent
(
temp_object
=
1
,
portal_type
=
'Simulation Movement'
,
title
=
'B'
,
start_date
=
DateTime
(
2001
,
1
,
1
)),
self
.
folder
.
newContent
(
temp_object
=
1
,
title
=
'A'
,
portal_type
=
'Simulation Movement'
,
start_date
=
DateTime
(
2001
,
1
,
2
)),
self
.
folder
.
newContent
(
temp_object
=
1
,
title
=
'A'
,
portal_type
=
'Simulation Movement'
,
start_date
=
DateTime
(
2001
,
1
,
3
)))
self
.
builder
.
newContent
(
portal_type
=
'Property Grouping Movement Group'
,
collect_order_group
=
'delivery'
,
tested_property_list
=
(
'start_date'
,
'title'
))
movement_group_node
=
self
.
builder
.
collectMovement
(
movement_list
)
group_list
=
movement_group_node
.
getGroupList
()
# must not be 4
self
.
assertEquals
(
3
,
len
(
group_list
))
for
group
in
group_list
:
# This movent group must not assign the properties
self
.
assertEquals
({},
group
.
getGroupEditDict
())
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
...
@@ -460,5 +535,6 @@ def test_suite():
...
@@ -460,5 +535,6 @@ def test_suite():
suite
.
addTest
(
unittest
.
makeSuite
(
TestDuplicatedKeyRaiseException
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestDuplicatedKeyRaiseException
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestCategoryMovementGroup
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestCategoryMovementGroup
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestMovementGroupCommonAPI
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestMovementGroupCommonAPI
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestPropertyGroupingMovementGroup
))
return
suite
return
suite
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