|
@ -47,7 +47,7 @@ class AttachmentExtensionTestCase(common.TransactionCase): |
|
|
self.sample = self.attachment_model.create({ |
|
|
self.sample = self.attachment_model.create({ |
|
|
'name': "test", |
|
|
'name': "test", |
|
|
'datas_fname': "sample.png", |
|
|
'datas_fname': "sample.png", |
|
|
'datas': base64.b64decode(file.read()), |
|
|
|
|
|
|
|
|
'datas': base64.b64encode(file.read()), |
|
|
}) |
|
|
}) |
|
|
self.assertEqual(self.sample.extension, ".png") |
|
|
self.assertEqual(self.sample.extension, ".png") |
|
|
|
|
|
|
|
@ -56,7 +56,7 @@ class AttachmentExtensionTestCase(common.TransactionCase): |
|
|
self.sample = self.attachment_model.create({ |
|
|
self.sample = self.attachment_model.create({ |
|
|
'name': "test", |
|
|
'name': "test", |
|
|
'mimetype': "image/png", |
|
|
'mimetype': "image/png", |
|
|
'datas': base64.business(file.read()), |
|
|
|
|
|
|
|
|
'datas': base64.b64encode(file.read()), |
|
|
}) |
|
|
}) |
|
|
self.assertEqual(self.sample.extension, ".png") |
|
|
self.assertEqual(self.sample.extension, ".png") |
|
|
|
|
|
|
|
|