summaryrefslogtreecommitdiff
path: root/addons/web
diff options
context:
space:
mode:
authorNicolas Galler <ngl@odoo.com>2020-10-13 13:09:27 +0000
committerNicolas Galler <ngl@odoo.com>2020-10-15 07:31:17 +0000
commit99b3f0be1b322ee469871f9496527e8dc3e778bb (patch)
tree0be9da954ad5254a4fcc0a2b1c36af5000d405c5 /addons/web
parentf997bc8f6e9d5138de6faed80e9774d359bfbe8d (diff)
[FIX] base: correct unit test for compatibility with PIL 7.0
The unit test in `test_base_document_layout` does not pass with version 7.0.0 of PIL, which is loaded by default on Ubuntu 20.04. The reason is that the color obtained from the image is slightly different. This fix slightly relaxes the test (in fact we don't care about the exact color obtained in this test, we just want to make sure that it doesn't crash) opw-2342394 (original ticket) closes odoo/odoo#59912 X-original-commit: 3028c814d62309bfa2a55f9aaa775738263d8326 Signed-off-by: Thomas Dieuzeide <tdi-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/web')
-rw-r--r--addons/web/tests/test_base_document_layout.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/tests/test_base_document_layout.py b/addons/web/tests/test_base_document_layout.py
index dd8f4e2ad24..0f3f9e8b1dc 100644
--- a/addons/web/tests/test_base_document_layout.py
+++ b/addons/web/tests/test_base_document_layout.py
@@ -195,7 +195,7 @@ class TestBaseDocumentLayout(TestBaseDocumentLayoutHelpers):
self.assertColors(doc_layout, self.company_imgs['sweden']['colors'])
def test_parse_company_colors_grayscale(self):
- """Grayscale images with transparency"""
+ """Grayscale images with transparency - make sure the color extraction does not crash"""
self.company.write({
'primary_color': '#ff0080',
'secondary_color': '#00ff00',
@@ -205,7 +205,7 @@ class TestBaseDocumentLayout(TestBaseDocumentLayoutHelpers):
with Image.open(os.path.join(dir_path, 'logo_ci.png'), 'r') as img:
base64_img = image_to_base64(img, 'PNG')
doc_layout.logo = base64_img
- self.assertEqual('#8d8d8d', doc_layout.primary_color)
+ self.assertNotEqual(None, doc_layout.primary_color)
# /!\ This case is NOT supported, and probably not supportable