Browse Source

[ADD] 'document_extract_from_database' New test to check if datas have changed;

pull/85/head
Sylvain LE GAL 10 years ago
parent
commit
fa4cfc7af2
  1. 12
      document_extract_from_database/tests/test_document_extract_from_database.py

12
document_extract_from_database/tests/test_document_extract_from_database.py

@ -50,6 +50,9 @@ class TestDocumentExtractFromDatabase(TransactionCase):
"""LR/w38AB6kDMQ1kMu8AAAAASUVORK5CYII=""", """LR/w38AB6kDMQ1kMu8AAAAASUVORK5CYII=""",
}) })
# Get Data Before
data_before = self.ia_obj.browse(cr, uid, ia_id).datas
# Change setting for attachment to save on filesystem # Change setting for attachment to save on filesystem
self.icp_obj.create(cr, uid, { self.icp_obj.create(cr, uid, {
'key': 'ir_attachment.location', 'key': 'ir_attachment.location',
@ -59,6 +62,15 @@ class TestDocumentExtractFromDatabase(TransactionCase):
# Run Write Again Functionnality # Run Write Again Functionnality
self.dma_obj.write_again(cr, uid, 0, {'active_ids': [ia_id]}) self.dma_obj.write_again(cr, uid, 0, {'active_ids': [ia_id]})
data_after = self.ia_obj.browse(cr, uid, ia_id).datas
# Test if datas have not changed
ia = self.ia_obj.browse(cr, uid, ia_id)
self.assertEqual(
data_before, data_after,
"Datas have changed after exporting into filesystem.")
# Test if the file is in the file system
ia = self.ia_obj.browse(cr, uid, ia_id) ia = self.ia_obj.browse(cr, uid, ia_id)
self.assertNotEqual( self.assertNotEqual(
ia.store_fname, None, ia.store_fname, None,

Loading…
Cancel
Save