server/test/unittest_storage.py
changeset 10614 57dfde80df11
parent 10550 d4bd28d5fca8
child 10704 73367a56ee41
--- a/server/test/unittest_storage.py	Thu Sep 17 09:52:06 2015 +0200
+++ b/server/test/unittest_storage.py	Tue Sep 15 15:33:47 2015 +0200
@@ -215,7 +215,7 @@
             f1 = cnx.create_entity('File', data=Binary(filepath),
                                    data_format=u'text/plain', data_name=u'foo')
             cw_value = f1.data.getvalue()
-            fs_value = file(filepath).read()
+            fs_value = open(filepath).read()
             if cw_value != fs_value:
                 self.fail('cw value %r is different from file content' % cw_value)
 
@@ -304,7 +304,7 @@
             old_fspath = self.fspath(cnx, f1)
             cnx.transaction_data['fs_importing'] = True
             new_fspath = osp.join(self.tempdir, 'newfile.txt')
-            file(new_fspath, 'w').write('the new data')
+            open(new_fspath, 'w').write('the new data')
             cnx.execute('SET F data %(d)s WHERE F eid %(f)s',
                          {'d': Binary(new_fspath), 'f': f1.eid})
             cnx.commit()