diff test/db_test_base.py @ 5492:6b0c542642be

blobfiles now always stores/returns bytes any conversation is done in the backend layer added a special "binary_content" property to read the data as bytes changed history generation to read property data on demand
author Christof Meerwald <cmeerw@cmeerw.org>
date Sun, 12 Aug 2018 16:05:42 +0100
parents 52cb53eedf77
children 725266c03eab
line wrap: on
line diff
--- a/test/db_test_base.py	Mon Aug 06 20:52:15 2018 +0100
+++ b/test/db_test_base.py	Sun Aug 12 16:05:42 2018 +0100
@@ -298,6 +298,11 @@
         self.db.commit()
         self.assertEqual(self.db.issue.get(nid, 'title'), ustr2)
 
+        # test set & retrieve (this time for file contents)
+        nid = self.db.file.create(content=ustr)
+        self.assertEqual(self.db.file.get(nid, 'content'), ustr)
+        self.assertEqual(self.db.file.get(nid, 'binary_content'), s2b(ustr))
+
     # Link
     def testLinkChange(self):
         self.assertRaises(IndexError, self.db.issue.create, title="spam",

Roundup Issue Tracker: http://roundup-tracker.org/