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
Binh
erp5
Commits
ae4fc245
Commit
ae4fc245
authored
May 29, 2017
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_item: Cleanup test
parent
c8f5fce8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
25 deletions
+32
-25
bt5/erp5_item/TestTemplateItem/portal_components/test.erp5.testItem.py
.../TestTemplateItem/portal_components/test.erp5.testItem.py
+7
-10
bt5/erp5_item/TestTemplateItem/portal_components/test.erp5.testItem.xml
...TestTemplateItem/portal_components/test.erp5.testItem.xml
+25
-15
No files found.
bt5/erp5_item/TestTemplateItem/portal_components/test.erp5.testItem.py
View file @
ae4fc245
...
...
@@ -31,7 +31,6 @@ import unittest
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
reindex
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5.tests.testInvoice
import
TestSaleInvoiceMixin
from
Products.ERP5.tests.utils
import
newSimulationExpectedFailure
...
...
@@ -159,7 +158,6 @@ class TestItemMixin(TestSaleInvoiceMixin):
def
stepCreateItemList
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
""" Create some items """
item_module
=
self
.
getPortal
().
item_module
resource
=
sequence
.
get
(
'resource'
)
item
=
item_module
.
newContent
(
portal_type
=
self
.
item_portal_type
)
sequence
.
edit
(
item_list
=
[
item
])
...
...
@@ -1137,7 +1135,6 @@ class TestItem(TestItemMixin, ERP5TypeTestCase):
self
.
assertEqual
(
1
,
len
(
item_by_hand_value_list
))
self
.
assertEqual
(
1
,
len
(
item_by_dialog_value_list
))
item_by_hand
=
item_by_hand_value_list
[
0
]
item_by_dialog
=
item_by_dialog_value_list
[
0
]
self
.
assertTrue
(
item_by_dialog
.
getTitle
().
startswith
(
resource
.
getTitle
()))
...
...
@@ -1281,42 +1278,42 @@ class TestItemScripts(ERP5TypeTestCase):
# with line
def
test_Item_getResourceValue
(
self
):
self
.
assertEqual
(
None
,
self
.
item
.
Item_getResourceValue
())
line
=
self
.
_makeSalePackingListLine
()
self
.
_makeSalePackingListLine
()
self
.
assertEqual
(
self
.
product
,
self
.
item
.
Item_getResourceValue
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getResourceValue
(
at_date
=
DateTime
()
-
2
))
def
test_Item_getResourceTitle
(
self
):
self
.
assertEqual
(
None
,
self
.
item
.
Item_getResourceTitle
())
line
=
self
.
_makeSalePackingListLine
()
self
.
_makeSalePackingListLine
()
self
.
assertEqual
(
'Product'
,
self
.
item
.
Item_getResourceTitle
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getResourceTitle
(
at_date
=
DateTime
()
-
2
))
def
test_Item_getCurrentOwnerValue
(
self
):
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentOwnerValue
())
line
=
self
.
_makeSalePackingListLine
()
self
.
_makeSalePackingListLine
()
self
.
assertEqual
(
self
.
section
,
self
.
item
.
Item_getCurrentOwnerValue
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentOwnerValue
(
at_date
=
DateTime
()
-
2
))
def
test_Item_getCurrentOwnerTitle
(
self
):
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentOwnerTitle
())
line
=
self
.
_makeSalePackingListLine
()
self
.
_makeSalePackingListLine
()
self
.
assertEqual
(
'Section'
,
self
.
item
.
Item_getCurrentOwnerTitle
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentOwnerTitle
(
at_date
=
DateTime
()
-
2
))
def
test_Item_getCurrentSiteValue
(
self
):
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentSiteValue
())
line
=
self
.
_makeSalePackingListLine
()
self
.
_makeSalePackingListLine
()
self
.
assertEqual
(
self
.
node
,
self
.
item
.
Item_getCurrentSiteValue
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentSiteValue
(
at_date
=
DateTime
()
-
2
))
def
test_Item_getCurrentSiteTitle
(
self
):
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentSiteTitle
())
line
=
self
.
_makeSalePackingListLine
()
self
.
_makeSalePackingListLine
()
self
.
assertEqual
(
'Node'
,
self
.
item
.
Item_getCurrentSiteTitle
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentSiteTitle
(
at_date
=
DateTime
()
-
2
))
...
...
@@ -1343,7 +1340,7 @@ class TestItemScripts(ERP5TypeTestCase):
destination_section_value
=
self
.
section
,
specialise_value
=
self
.
portal
.
business_process_module
.
erp5_default_business_process
,
start_date
=
DateTime
()
-
1
,)
line
=
packing_list
.
newContent
(
packing_list
.
newContent
(
portal_type
=
'Sale Packing List Line'
,
quantity
=
1
,
resource_value
=
self
.
product
,
...
...
bt5/erp5_item/TestTemplateItem/portal_components/test.erp5.testItem.xml
View file @
ae4fc245
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testItem
</string>
</value>
...
...
@@ -39,18 +45,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:174, 4: Unused variable \'resource\' (unused-variable)
</string>
<string>
W:1152, 4: Unused variable \'item_by_hand\' (unused-variable)
</string>
<string>
W:1302, 4: Unused variable \'line\' (unused-variable)
</string>
<string>
W:1309, 4: Unused variable \'line\' (unused-variable)
</string>
<string>
W:1316, 4: Unused variable \'line\' (unused-variable)
</string>
<string>
W:1323, 4: Unused variable \'line\' (unused-variable)
</string>
<string>
W:1330, 4: Unused variable \'line\' (unused-variable)
</string>
<string>
W:1337, 4: Unused variable \'line\' (unused-variable)
</string>
<string>
W:1364, 4: Unused variable \'line\' (unused-variable)
</string>
<string>
W: 34, 0: Unused newSecurityManager imported from AccessControl.SecurityManagement (unused-import)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -60,13 +55,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -79,7 +89,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -88,7 +98,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
...
...
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