mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-23 21:02:01 +02:00
19.0 vanilla
This commit is contained in:
parent
ba20ce7443
commit
768b70e05e
2357 changed files with 1057103 additions and 712486 deletions
|
|
@ -0,0 +1,25 @@
|
|||
from odoo import http
|
||||
from odoo.tests import tagged, HttpCase
|
||||
|
||||
|
||||
@tagged("-at_install", "post_install")
|
||||
class TestAccountMoveAttachment(HttpCase):
|
||||
|
||||
def test_preserving_manually_added_attachments(self):
|
||||
""" Preserve attachments manually added (not coming from emails) to an invoice """
|
||||
self.authenticate("admin", "admin")
|
||||
|
||||
invoice = self.env['account.move'].create({
|
||||
'move_type': 'out_invoice',
|
||||
})
|
||||
self.assertFalse(invoice.attachment_ids)
|
||||
response = self.url_open("/mail/attachment/upload",
|
||||
{
|
||||
"csrf_token": http.Request.csrf_token(self),
|
||||
"thread_id": invoice.id,
|
||||
"thread_model": "account.move",
|
||||
},
|
||||
files={'ufile': ('salut.txt', b"Salut !\n", 'text/plain')},
|
||||
)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTrue(invoice.attachment_ids)
|
||||
Loading…
Add table
Add a link
Reference in a new issue