mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-19 11:52:18 -06:00
[16.0][MIG] document_url: Migration to 16.0
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
import base64
|
||||
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
@@ -27,3 +29,11 @@ class TestDocumentUrl(common.TransactionCase):
|
||||
self.assertEqual(attachment_added_count, 1)
|
||||
attachment = self.env["ir.attachment"].search(domain)
|
||||
self.assertEqual(attachment.mimetype, "application/link")
|
||||
|
||||
def test_dont_broke_default_compute_mimetype(self):
|
||||
blob1 = b"blob1"
|
||||
blob1_b64 = base64.b64encode(blob1)
|
||||
attachment = self.env["ir.attachment"].create(
|
||||
{"name": "a2", "datas": blob1_b64, "mimetype": "image/png"}
|
||||
)
|
||||
self.assertEqual(attachment.mimetype, "image/png")
|
||||
|
||||
Reference in New Issue
Block a user