- Timestamp:
- 21 Dec 2014, 22:32:59 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/documents/tests/test_browser.py
r12269 r12290 52 52 exporter.export_all(self.app, self.outfile) 53 53 result = open(self.outfile, 'rb').read() 54 self.assertEqual(result, 55 'description,document_id,title,users_with_local_roles\r\n' 56 ',DOC1,My first document,[]\r\n') 54 self.assertMatches(result, 55 'class_name,description,document_id,history,state,title,' 56 'users_with_local_roles\r\n' 57 'SkeletonDocument,,DOC1,' 58 '[u\'2014-12-21 23:27:15 WAT - Document created by system\'],' 59 'created,My first document,[]\r\n') 57 60 # We can import the same file. 58 61 processor = SkeletonDocumentProcessor() 59 62 result = processor.doImport( 60 63 self.outfile, 61 ['description','document_id','title','users_with_local_roles'], 64 ['class_name','description','document_id','history','state', 65 'title','users_with_local_roles'], 62 66 mode='create') 63 67 num, num_fail, finished_path, failed_path = result … … 69 73 result = processor.doImport( 70 74 self.outfile, 71 ['description','document_id','title','users_with_local_roles'], 72 mode='create') 73 num_succ, num_fail, finished_path, failed_path = result 74 self.assertEqual(num_fail,1) 75 # ... only if we add column 76 open(self.outfile, 'wb').write( 77 'description,document_id,title,users_with_local_roles,class_name\r\n' 78 ',DOC1,My first title,[],SkeletonDocument\r\n') 79 result = processor.doImport( 80 self.outfile, 81 ['description','document_id','title','users_with_local_roles','class_name'], 75 ['class_name','description','document_id','history','state', 76 'title','users_with_local_roles'], 82 77 mode='create') 83 78 num_succ, num_fail, finished_path, failed_path = result … … 87 82 result = processor.doImport( 88 83 self.outfile, 89 ['description','document_id','title','users_with_local_roles'], 84 ['class_name','description','document_id','history','state', 85 'title','users_with_local_roles'], 90 86 mode='update') 91 87 num_succ, num_fail, finished_path, failed_path = result
Note: See TracChangeset for help on using the changeset viewer.