Browse Source

Update

pull/5/head
Mathias Markl 7 years ago
parent
commit
ce3124bf41
  1. 10
      muk_web_preview_attachment/tests/test_attachment_extension.py

10
muk_web_preview_attachment/tests/test_attachment_extension.py

@ -42,7 +42,7 @@ class AttachmentExtensionTestCase(common.TransactionCase):
def tearDown(self):
super(AttachmentExtensionTestCase, self).tearDown()
def test_attachment_extension(self):
def test_attachment_extension_filename(self):
with closing(open(os.path.join(_path, 'tests/data/sample.png'), 'r')) as file:
self.sample = self.attachment_model.create({
'name': "test",
@ -51,6 +51,14 @@ class AttachmentExtensionTestCase(common.TransactionCase):
})
self.assertEqual(self.sample.extension, ".png")
def test_attachment_extension_bianry(self):
with closing(open(os.path.join(_path, 'tests/data/sample.png'), 'r')) as file:
self.sample = self.attachment_model.create({
'name': "test",
'datas': base64.encodestring(file.read()),
})
self.assertEqual(self.sample.extension, ".png")
Loading…
Cancel
Save