From fa4cfc7af27d0f86d8e814d713f551f433f88437 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Thu, 20 Nov 2014 10:27:37 +0100 Subject: [PATCH] [ADD] 'document_extract_from_database' New test to check if datas have changed; --- .../tests/test_document_extract_from_database.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/document_extract_from_database/tests/test_document_extract_from_database.py b/document_extract_from_database/tests/test_document_extract_from_database.py index 07d3c7cac..5cc844dd2 100644 --- a/document_extract_from_database/tests/test_document_extract_from_database.py +++ b/document_extract_from_database/tests/test_document_extract_from_database.py @@ -50,6 +50,9 @@ class TestDocumentExtractFromDatabase(TransactionCase): """LR/w38AB6kDMQ1kMu8AAAAASUVORK5CYII=""", }) + # Get Data Before + data_before = self.ia_obj.browse(cr, uid, ia_id).datas + # Change setting for attachment to save on filesystem self.icp_obj.create(cr, uid, { 'key': 'ir_attachment.location', @@ -59,6 +62,15 @@ class TestDocumentExtractFromDatabase(TransactionCase): # Run Write Again Functionnality 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) self.assertNotEqual( ia.store_fname, None,