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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
654499dc
Commit
654499dc
authored
Feb 27, 2013
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle use cases when reference is just None. Add test for this case.
parent
2ef1dd35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
product/ERP5/Document/Document.py
product/ERP5/Document/Document.py
+3
-1
product/ERP5OOo/tests/testDms.py
product/ERP5OOo/tests/testDms.py
+7
-0
No files found.
product/ERP5/Document/Document.py
View file @
654499dc
...
@@ -326,7 +326,9 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
...
@@ -326,7 +326,9 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
certain
defined
at
system
level
preferences
format
.
certain
defined
at
system
level
preferences
format
.
"""
"""
reference = self.getReference()
reference = self.getReference()
return len(self._getSearchableReferenceList(reference))
if reference is not None:
return len(self._getSearchableReferenceList(reference))
return False
def _getSearchableReferenceList(self, text):
def _getSearchableReferenceList(self, text):
"""
"""
...
...
product/ERP5OOo/tests/testDms.py
View file @
654499dc
...
@@ -596,6 +596,13 @@ class TestDocument(TestDocumentMixin):
...
@@ -596,6 +596,13 @@ class TestDocument(TestDocumentMixin):
[
document3
],
[
document3
],
sqlresult_to_document_list
(
document5
.
getImplicitSuccessorValueList
()))
sqlresult_to_document_list
(
document5
.
getImplicitSuccessorValueList
()))
# with empty reference no implicit relation should exists even though some documents
# used to reference us with previous reference
document1
.
setReference
(
None
)
self
.
tic
()
self
.
assertSameSet
([],
sqlresult_to_document_list
(
document1
.
getImplicitPredecessorValueList
()))
def
testOOoDocument_get_size
(
self
):
def
testOOoDocument_get_size
(
self
):
# test get_size on OOoDocument
# test get_size on OOoDocument
doc
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'Spreadsheet'
)
doc
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'Spreadsheet'
)
...
...
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