Commit e6422ba6 authored by Ivan Tyagov's avatar Ivan Tyagov

Clean up logging.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37208 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 34b42404
...@@ -78,19 +78,6 @@ TEST_FILES_HOME = os.path.join(os.path.dirname(__file__), 'test_document') ...@@ -78,19 +78,6 @@ TEST_FILES_HOME = os.path.join(os.path.dirname(__file__), 'test_document')
FILE_NAME_REGULAR_EXPRESSION = "(?P<reference>[A-Z]{3,10})-(?P<language>[a-z]{2})-(?P<version>[0-9]{3})" FILE_NAME_REGULAR_EXPRESSION = "(?P<reference>[A-Z]{3,10})-(?P<language>[a-z]{2})-(?P<version>[0-9]{3})"
REFERENCE_REGULAR_EXPRESSION = "(?P<reference>[A-Z]{3,10})(-(?P<language>[a-z]{2}))?(-(?P<version>[0-9]{3}))?" REFERENCE_REGULAR_EXPRESSION = "(?P<reference>[A-Z]{3,10})(-(?P<language>[a-z]{2}))?(-(?P<version>[0-9]{3}))?"
def printAndLog(msg):
"""
A utility function to print a message
to the standard output and to the LOG
at the same time
"""
if not QUIET:
msg = str(msg)
ZopeTestCase._print('\n ' + msg)
LOG('Testing... ', 0, msg)
def makeFilePath(name): def makeFilePath(name):
return os.path.join(os.path.dirname(__file__), 'test_document', name) return os.path.join(os.path.dirname(__file__), 'test_document', name)
...@@ -235,7 +222,6 @@ class TestDocument(TestDocumentMixin): ...@@ -235,7 +222,6 @@ class TestDocument(TestDocumentMixin):
""" """
Standard test to make sure we have everything we need - all the tools etc Standard test to make sure we have everything we need - all the tools etc
""" """
printAndLog('\nTest Has Everything ')
self.assertNotEqual(self.getCategoryTool(), None) self.assertNotEqual(self.getCategoryTool(), None)
self.assertNotEqual(self.getSimulationTool(), None) self.assertNotEqual(self.getSimulationTool(), None)
self.assertNotEqual(self.getTypeTool(), None) self.assertNotEqual(self.getTypeTool(), None)
...@@ -247,7 +233,6 @@ class TestDocument(TestDocumentMixin): ...@@ -247,7 +233,6 @@ class TestDocument(TestDocumentMixin):
""" """
Test revision mechanism Test revision mechanism
""" """
printAndLog('\nTest Revision System')
# create a test document # create a test document
# revision should be 1 # revision should be 1
# upload file (can be the same) into it # upload file (can be the same) into it
...@@ -284,7 +269,6 @@ class TestDocument(TestDocumentMixin): ...@@ -284,7 +269,6 @@ class TestDocument(TestDocumentMixin):
""" """
Test versioning Test versioning
""" """
printAndLog('\nTest Versioning System')
# create a document 1, set coordinates (reference=TEST, version=002, language=en) # create a document 1, set coordinates (reference=TEST, version=002, language=en)
# create a document 2, set coordinates (reference=TEST, version=002, language=en) # create a document 2, set coordinates (reference=TEST, version=002, language=en)
# create a document 3, set coordinates (reference=TEST, version=004, language=en) # create a document 3, set coordinates (reference=TEST, version=004, language=en)
...@@ -320,7 +304,6 @@ class TestDocument(TestDocumentMixin): ...@@ -320,7 +304,6 @@ class TestDocument(TestDocumentMixin):
""" """
Test versioning with multi-language support Test versioning with multi-language support
""" """
printAndLog('\nTest Versioning With Language')
# create empty test documents, set their coordinates as follows: # create empty test documents, set their coordinates as follows:
# (1) TEST, 002, en # (1) TEST, 002, en
# (2) TEST, 002, fr # (2) TEST, 002, fr
...@@ -378,8 +361,6 @@ class TestDocument(TestDocumentMixin): ...@@ -378,8 +361,6 @@ class TestDocument(TestDocumentMixin):
Explicit relations are just like any other relation, so no need to test them here Explicit relations are just like any other relation, so no need to test them here
except for similarity cloud which we test. except for similarity cloud which we test.
""" """
printAndLog('\nTest Explicit Relations')
# create test documents: # create test documents:
# (1) TEST, 002, en # (1) TEST, 002, en
# (2) TEST, 003, en # (2) TEST, 003, en
...@@ -482,7 +463,6 @@ class TestDocument(TestDocumentMixin): ...@@ -482,7 +463,6 @@ class TestDocument(TestDocumentMixin):
def sqlresult_to_document_list(result): def sqlresult_to_document_list(result):
return [i.getObject() for i in result] return [i.getObject() for i in result]
printAndLog('\nTest Implicit Relations')
# create docs to be referenced: # create docs to be referenced:
# (1) TEST, 002, en # (1) TEST, 002, en
filename = 'TEST-en-002.odt' filename = 'TEST-en-002.odt'
...@@ -527,7 +507,6 @@ class TestDocument(TestDocumentMixin): ...@@ -527,7 +507,6 @@ class TestDocument(TestDocumentMixin):
transaction.commit() transaction.commit()
self.tic() self.tic()
printAndLog('\nTesting Implicit Predecessors')
# the implicit predecessor will find documents by reference. # the implicit predecessor will find documents by reference.
# version and language are not used. # version and language are not used.
# the implicit predecessors should be: # the implicit predecessors should be:
...@@ -542,7 +521,6 @@ class TestDocument(TestDocumentMixin): ...@@ -542,7 +521,6 @@ class TestDocument(TestDocumentMixin):
# clear transactional variable cache # clear transactional variable cache
transaction.commit() transaction.commit()
printAndLog('\nTesting Implicit Successors')
# the implicit successors should be return document with appropriate # the implicit successors should be return document with appropriate
# language. # language.
...@@ -682,7 +660,6 @@ class TestDocument(TestDocumentMixin): ...@@ -682,7 +660,6 @@ class TestDocument(TestDocumentMixin):
Check that the processing state of a cloned document Check that the processing state of a cloned document
is not draft is not draft
""" """
printAndLog('\nProcessing State of a Cloned Document')
filename = 'TEST-en-002.doc' filename = 'TEST-en-002.doc'
file = makeFileUpload(filename) file = makeFileUpload(filename)
document = self.portal.portal_contributions.newContent(file=file) document = self.portal.portal_contributions.newContent(file=file)
...@@ -723,7 +700,6 @@ class TestDocument(TestDocumentMixin): ...@@ -723,7 +700,6 @@ class TestDocument(TestDocumentMixin):
Check the validation state of embedded document when its container is Check the validation state of embedded document when its container is
cloned cloned
""" """
printAndLog('\nValidation State of a Cloned Document')
filename = 'TEST-en-002.doc' filename = 'TEST-en-002.doc'
file = makeFileUpload(filename) file = makeFileUpload(filename)
document = self.portal.portal_contributions.newContent(file=file) document = self.portal.portal_contributions.newContent(file=file)
...@@ -753,7 +729,6 @@ class TestDocument(TestDocumentMixin): ...@@ -753,7 +729,6 @@ class TestDocument(TestDocumentMixin):
""" """
Check the validation state of an embedded document Check the validation state of an embedded document
""" """
printAndLog('\nValidation State of an Embedded Document')
filename = 'EmbeddedImage-en-002.odt' filename = 'EmbeddedImage-en-002.odt'
file = makeFileUpload(filename) file = makeFileUpload(filename)
document = self.portal.portal_contributions.newContent(file=file) document = self.portal.portal_contributions.newContent(file=file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment