Browse Source

publish muk_attachment_lobject - 12.0

pull/9/head
MuK IT GmbH 6 years ago
parent
commit
47d7c054a8
  1. 2
      muk_attachment_lobject/models/ir_attachment.py
  2. 3
      muk_attachment_lobject/tests/test_attachment.py

2
muk_attachment_lobject/models/ir_attachment.py

@ -64,7 +64,7 @@ class LObjectIrAttachment(models.Model):
for attach in self:
if attach.store_lobject:
if bin_size:
attach.datas = attach.store_lobject
attach.datas = attach.with_context({'human_size': True}).store_lobject
else:
attach.datas = attach.with_context({'base64': True}).store_lobject
else:

3
muk_attachment_lobject/tests/test_attachment.py

@ -45,6 +45,9 @@ class AttachmentTestCase(common.HttpCase):
'datas': base64.b64encode(b"\xff data")})
self.assertTrue(attach.datas)
self.assertTrue(attach.with_context({'bin_size': True}).datas)
self.assertTrue(attach.with_context({'human_size': True}).datas)
self.assertTrue(attach.with_context({'base64': True}).datas)
self.assertTrue(attach.with_context({'stream': True}).datas)
oid = attach.with_context({'oid': True}).store_lobject
self.assertTrue(oid)
attach.write({'datas': base64.b64encode(b"\xff data")})

Loading…
Cancel
Save