|
@ -51,10 +51,11 @@ class AttachmentExtensionTestCase(common.TransactionCase): |
|
|
}) |
|
|
}) |
|
|
self.assertEqual(self.sample.extension, ".png") |
|
|
self.assertEqual(self.sample.extension, ".png") |
|
|
|
|
|
|
|
|
def test_attachment_extension_bianry(self): |
|
|
|
|
|
|
|
|
def test_attachment_extension_mimetype(self): |
|
|
with closing(open(os.path.join(_path, 'tests/data/sample.png'), 'r')) as file: |
|
|
with closing(open(os.path.join(_path, 'tests/data/sample.png'), 'r')) as file: |
|
|
self.sample = self.attachment_model.create({ |
|
|
self.sample = self.attachment_model.create({ |
|
|
'name': "test", |
|
|
'name': "test", |
|
|
|
|
|
'mimetype': "image/png", |
|
|
'datas': base64.encodestring(file.read()), |
|
|
'datas': base64.encodestring(file.read()), |
|
|
}) |
|
|
}) |
|
|
self.assertEqual(self.sample.extension, ".png") |
|
|
self.assertEqual(self.sample.extension, ".png") |
|
|