Ignore:
Timestamp:
21 Dec 2014, 17:00:10 (10 years ago)
Author:
Henrik Bettermann
Message:

Extend DocumentExporterBase?. We need to know more about exported documents.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_export.py

    r12266 r12287  
    6262        exporter.export([self.pdfdocument], self.outfile)
    6363        result = open(self.outfile, 'rb').read()
    64         self.assertTrue(
    65             'description,document_id,title,users_with_local_roles\r\n'
    66             ',DOC1,,"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"'
    67             in result
     64        self.assertMatches(
     65            'class_name,description,document_id,history,state,title,users_with_local_roles\r\n'
     66            'PDFDocument,,DOC1,'
     67            '[u\'2014-12-21 16:55:16 UTC - Document created by system\'],'
     68            'created,,"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"',
     69            result
    6870            )
    6971        return
     
    7476        exporter.export_all(self.app, self.outfile)
    7577        result = open(self.outfile, 'rb').read()
    76         self.assertTrue(
    77             'description,document_id,title,users_with_local_roles\r\n'
    78             ',DOC1,,"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"'
    79             in result
     78        self.assertMatches(
     79            'class_name,description,document_id,history,state,title,users_with_local_roles\r\n'
     80            'PDFDocument,,DOC1,'
     81            '[u\'2014-12-21 16:55:16 UTC - Document created by system\'],'
     82            'created,,"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"',
     83            result
    8084            )
    8185        return
     
    109113        exporter.export([self.htmldocument], self.outfile)
    110114        result = open(self.outfile, 'rb').read()
    111         self.assertTrue(
    112             'description,document_id,html_multilingual,title,'
    113             'users_with_local_roles\r\n,DOC2,'
    114             ',,'
    115             '"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"\r\n'
    116             in result
     115        self.assertMatches(
     116            'class_name,description,document_id,history,html_dict,'
     117            'html_multilingual,state,title,users_with_local_roles\r\n'
     118            'HTMLDocument,,DOC2,'
     119            '[u\'2014-12-21 16:50:28 UTC - Document created by system\'],'
     120            '{},,created,,"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"',
     121            result
    117122            )
    118123        return
     
    123128        exporter.export_all(self.app, self.outfile)
    124129        result = open(self.outfile, 'rb').read()
    125         self.assertTrue(
    126             'description,document_id,html_multilingual,title,'
    127             'users_with_local_roles\r\n,DOC2,'
    128             ',,'
    129             '"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"\r\n'
    130             in result
     130        self.assertMatches(
     131            'class_name,description,document_id,history,html_dict,'
     132            'html_multilingual,state,title,users_with_local_roles\r\n'
     133            'HTMLDocument,,DOC2,'
     134            '[u\'2014-12-21 16:50:28 UTC - Document created by system\'],'
     135            '{},,created,,"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"',
     136            result
    131137            )
    132138        return
Note: See TracChangeset for help on using the changeset viewer.