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
Gabriel Monnerat
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
from
Products.ERP5Type.tests.utils
import
reindex
from
DateTime
import
DateTime
class
TestTaskReporting
(
ERP5ReportTestCase
):
"""Test Task Reporting
"""
class
TestTaskReportingMixin
(
ERP5ReportTestCase
):
business_process
=
\
'business_process_module/erp5_default_task_business_process'
def
getTitle
(
self
):
return
"Task Reporting"
def
getBusinessTemplateList
(
self
):
"""Returns list of BT to be installed."""
return
(
'erp5_core_proxy_field_legacy'
,
...
...
@@ -84,13 +80,13 @@ class TestTaskReporting(ERP5ReportTestCase):
id
=
'Organisation_2'
)
# 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
(
portal_type
=
'Person'
,
reference
=
'Person_1'
,
title
=
'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
(
portal_type
=
'Person'
,
reference
=
'Person_2'
,
...
...
@@ -112,7 +108,7 @@ class TestTaskReporting(ERP5ReportTestCase):
project
.
newContent
(
portal_type
=
'Project Line'
,
id
=
'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
(
portal_type
=
'Project'
,
reference
=
'Project_2'
,
...
...
@@ -152,18 +148,28 @@ class TestTaskReporting(ERP5ReportTestCase):
# and all this available to catalog
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
):
"""Remove all documents.
"""
self
.
abort
()
portal
=
self
.
portal
portal
.
task_module
.
manage_delObjects
(
list
(
portal
.
task_module
.
objectIds
()))
portal
.
task_report_module
.
manage_delObjects
(
list
(
portal
.
task_report_module
.
objectIds
()))
portal
.
portal_simulation
.
manage_delObjects
(
list
(
portal
.
portal_simulation
.
objectIds
()))
self
.
tic
()
remove patches
"""
self
.
simulation_class
.
getInventoryList
=
self
.
initial_getInventoryList
class
TestTaskReporting
(
TestTaskReportingMixin
):
"""Test Task Reporting
"""
def
getTitle
(
self
):
return
"Task Reporting"
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