Since [1] the file size is displayed only for images that support processing (filter effect, crop, resize...) but when switching to an image that does not support it, the old size remains displayed. After this commit when an image for which the file size is not computed is selected, the previous file size is hidden. Steps to reproduce: - drop a Text-Image snippet - select the image => the size is displayed in the options block title - replace the image with an animated gif => previous size did remain displayed (now size is not shown anymore) [1]: https://github.com/odoo/odoo/commit/089ae3d28b5d2d7bdbaad133174ae54240113181 task-2729177 X-original-commit: 378f67749a51d8c0b9fb65767faceaa0844916e5 Part-of: odoo/odoo#95963
23 lines
707 B
Python
23 lines
707 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
import base64
|
|
|
|
import odoo.tests
|
|
from odoo.tools import mute_logger
|
|
|
|
|
|
@odoo.tests.common.tagged('post_install', '-at_install')
|
|
class TestMedia(odoo.tests.HttpCase):
|
|
|
|
@mute_logger('odoo.addons.http_routing.models.ir_http', 'odoo.http')
|
|
def test_01_replace_media(self):
|
|
SVG = base64.b64encode(b'<svg xmlns="http://www.w3.org/2000/svg"></svg>')
|
|
self.env['ir.attachment'].create({
|
|
'name': 'sample.svg',
|
|
'public': True,
|
|
'mimetype': 'image/svg+xml',
|
|
'datas': SVG,
|
|
})
|
|
self.start_tour("/", 'test_replace_media', login="admin")
|