mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 10:12:01 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import test_dms_attachment_link
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 2023 Tecnativa - Víctor Martínez
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.addons.base.tests.common import BaseCommon
|
||||
|
||||
|
||||
class TestDmsAttachmentLink(BaseCommon):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.partner = cls.env["res.partner"].create({"name": "Test partner"})
|
||||
cls.dms_file = cls.env.ref("dms.file_01_demo")
|
||||
|
||||
def test_add_url_attachment(self):
|
||||
attachment = self.dms_file.with_context(
|
||||
active_model=self.partner._name,
|
||||
active_id=self.partner.id,
|
||||
).action_create_attachment_from_record()
|
||||
self.assertEqual(attachment.name, self.dms_file.name)
|
||||
self.assertEqual(attachment.datas, self.dms_file.content)
|
||||
Loading…
Add table
Add a link
Reference in a new issue