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
Georgios Dagkakis
erp5
Commits
93cb35e1
Commit
93cb35e1
authored
Dec 27, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
administration: test for incremental mode of consistency alarm
parent
a5a9ad20
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
bt5/erp5_administration/TestTemplateItem/portal_components/test.erp5.testERP5Administration.py
...tem/portal_components/test.erp5.testERP5Administration.py
+33
-0
No files found.
bt5/erp5_administration/TestTemplateItem/portal_components/test.erp5.testERP5Administration.py
View file @
93cb35e1
...
...
@@ -28,6 +28,7 @@
##############################################################################
import
unittest
import
time
from
Products.ERP5.tests.testInventoryAPI
import
InventoryAPITestCase
class
TestERP5Administration
(
InventoryAPITestCase
):
...
...
@@ -113,6 +114,38 @@ class TestERP5Administration(InventoryAPITestCase):
self
.
tic
()
self
.
assertEqual
(
'3'
,
inconsistent_document
.
title
)
def
test_check_consistency_incremental
(
self
):
alarm
=
self
.
portal
.
portal_alarms
.
check_consistency
.
Base_createCloneDocument
(
batch_mode
=
True
)
alarm
.
edit
(
incremental_check
=
True
)
alarm
.
activeSense
()
self
.
tic
()
# create an inconsistent document
inconsistent_document
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
)
inconsistent_document
.
title
=
0
self
.
tic
()
# alarm report this document as not consistent
time
.
sleep
(
2
)
# catalog date columns have a one second precision
alarm
.
activeSense
()
self
.
tic
()
self
.
assertTrue
(
alarm
.
sense
())
result
,
=
alarm
.
getLastActiveProcess
().
getResultList
()
constraint_message
,
=
result
.
getProperty
(
'constraint_message_list'
)
self
.
assertEqual
(
inconsistent_document
.
getRelativeUrl
(),
constraint_message
.
object_relative_url
)
# next time the alarm run, document is not reported anymore
alarm
.
activeSense
()
self
.
tic
()
self
.
assertFalse
(
alarm
.
sense
())
self
.
assertEqual
([],
alarm
.
getLastActiveProcess
().
getResultList
())
# cleanup
self
.
portal
.
organisation_module
.
manage_delObjects
(
ids
=
[
inconsistent_document
.
getId
()])
self
.
tic
()
def
test_missing_category_document_constraint
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
# This category does not exist
...
...
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