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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
fc4919e2
Commit
fc4919e2
authored
Nov 14, 2013
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testTaskReporting: make this test able to run on live instance without deletions
parent
e57eb7c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
19 deletions
+25
-19
product/ERP5/tests/testTaskReporting.py
product/ERP5/tests/testTaskReporting.py
+25
-19
No files found.
product/ERP5/tests/testTaskReporting.py
View file @
fc4919e2
...
@@ -31,15 +31,11 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase
...
@@ -31,15 +31,11 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase
from
Products.ERP5Type.tests.utils
import
reindex
from
Products.ERP5Type.tests.utils
import
reindex
from
DateTime
import
DateTime
from
DateTime
import
DateTime
class
TestTaskReporting
(
ERP5ReportTestCase
):
class
TestTaskReportingMixin
(
ERP5ReportTestCase
):
"""Test Task Reporting
"""
business_process
=
\
business_process
=
\
'business_process_module/erp5_default_task_business_process'
'business_process_module/erp5_default_task_business_process'
def
getTitle
(
self
):
return
"Task Reporting"
def
getBusinessTemplateList
(
self
):
def
getBusinessTemplateList
(
self
):
"""Returns list of BT to be installed."""
"""Returns list of BT to be installed."""
return
(
'erp5_core_proxy_field_legacy'
,
return
(
'erp5_core_proxy_field_legacy'
,
...
@@ -84,13 +80,13 @@ class TestTaskReporting(ERP5ReportTestCase):
...
@@ -84,13 +80,13 @@ class TestTaskReporting(ERP5ReportTestCase):
id
=
'Organisation_2'
)
id
=
'Organisation_2'
)
# create persons
# create persons
if
not
self
.
portal
.
organisati
on_module
.
has_key
(
'Person_1'
):
if
not
self
.
portal
.
pers
on_module
.
has_key
(
'Person_1'
):
org
=
self
.
portal
.
person_module
.
newContent
(
org
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
portal_type
=
'Person'
,
reference
=
'Person_1'
,
reference
=
'Person_1'
,
title
=
'Person_1'
,
title
=
'Person_1'
,
id
=
'Person_1'
)
id
=
'Person_1'
)
if
not
self
.
portal
.
organisati
on_module
.
has_key
(
'Person_2'
):
if
not
self
.
portal
.
pers
on_module
.
has_key
(
'Person_2'
):
org
=
self
.
portal
.
person_module
.
newContent
(
org
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
portal_type
=
'Person'
,
reference
=
'Person_2'
,
reference
=
'Person_2'
,
...
@@ -112,7 +108,7 @@ class TestTaskReporting(ERP5ReportTestCase):
...
@@ -112,7 +108,7 @@ class TestTaskReporting(ERP5ReportTestCase):
project
.
newContent
(
portal_type
=
'Project Line'
,
project
.
newContent
(
portal_type
=
'Project Line'
,
id
=
'Line_2'
,
id
=
'Line_2'
,
title
=
'Line_2'
)
title
=
'Line_2'
)
if
not
self
.
portal
.
organisation
_module
.
has_key
(
'Project_2'
):
if
not
self
.
portal
.
project
_module
.
has_key
(
'Project_2'
):
project
=
self
.
portal
.
project_module
.
newContent
(
project
=
self
.
portal
.
project_module
.
newContent
(
portal_type
=
'Project'
,
portal_type
=
'Project'
,
reference
=
'Project_2'
,
reference
=
'Project_2'
,
...
@@ -152,18 +148,28 @@ class TestTaskReporting(ERP5ReportTestCase):
...
@@ -152,18 +148,28 @@ class TestTaskReporting(ERP5ReportTestCase):
# and all this available to catalog
# and all this available to catalog
self
.
tic
()
self
.
tic
()
# Patch getInventoryList to only take movement created in the test
self
.
simulation_class
=
self
.
portal
.
portal_simulation
.
__class__
self
.
initial_getInventoryList
=
initial_getInventoryList
=
\
self
.
simulation_class
.
getInventoryList
now
=
DateTime
()
def
getInventoryList
(
self
,
**
kw
):
return
initial_getInventoryList
(
self
,
modification_date
=
{
"query"
:
now
,
"range"
:
"min"
},
**
kw
)
self
.
simulation_class
.
getInventoryList
=
getInventoryList
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
"""Remove all documents.
"""
"""
self
.
abort
()
remove patches
portal
=
self
.
portal
"""
portal
.
task_module
.
manage_delObjects
(
self
.
simulation_class
.
getInventoryList
=
self
.
initial_getInventoryList
list
(
portal
.
task_module
.
objectIds
()))
portal
.
task_report_module
.
manage_delObjects
(
class
TestTaskReporting
(
TestTaskReportingMixin
):
list
(
portal
.
task_report_module
.
objectIds
()))
"""Test Task Reporting
portal
.
portal_simulation
.
manage_delObjects
(
"""
list
(
portal
.
portal_simulation
.
objectIds
()))
def
getTitle
(
self
):
self
.
tic
()
return
"Task Reporting"
def
testProjectMontlyReport
(
self
):
def
testProjectMontlyReport
(
self
):
"""
"""
...
...
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