Skip to content

Commit 111833c

Browse files
committed
assertLog instead
1 parent fd03bae commit 111833c

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

web_iconify_proxy/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Credits
6969
Authors
7070
-------
7171

72-
* Jaco
72+
* jaco.tech
7373

7474
Contributors
7575
------------

web_iconify_proxy/__manifest__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright 2025 jaco.tech
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
14
{
25
"name": "Web Iconify Proxy",
36
"summary": "Proxies requests to the Iconify API, providing SVG icons, CSS,"
@@ -6,7 +9,7 @@
69
"version": "18.0.1.0.0",
710
"category": "Website",
811
"website": "https://github.com/OCA/web",
9-
"author": "Odoo Community Association (OCA), Jaco",
12+
"author": "jaco.tech, Odoo Community Association (OCA)",
1013
"license": "LGPL-3",
1114
"depends": ["web"],
1215
"data": [],

web_iconify_proxy/static/description/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ <h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
419419
<div class="section" id="authors">
420420
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
421421
<ul class="simple">
422-
<li>Jaco</li>
422+
<li>jaco.tech</li>
423423
</ul>
424424
</div>
425425
<div class="section" id="contributors">

web_iconify_proxy/tests/test_main.py

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import base64
2-
import logging
32
from unittest.mock import patch
43

54
import requests
@@ -10,16 +9,6 @@
109

1110
@tagged("post_install", "-at_install")
1211
class TestIconifyProxyController(HttpCase):
13-
@classmethod
14-
def setUpClass(cls):
15-
super().setUpClass()
16-
logging.disable(logging.CRITICAL)
17-
18-
@classmethod
19-
def tearDownClass(cls):
20-
super().tearDownClass()
21-
logging.disable(logging.NOTSET)
22-
2312
@patch("odoo.addons.web_iconify_proxy.controllers.main.requests.get")
2413
def test_get_svg_success(self, mock_get):
2514
mock_response = requests.Response()
@@ -144,5 +133,7 @@ def test_caching(self, mock_get):
144133
def test_api_error(self, mock_get):
145134
# Mock requests.get to simulate an API error
146135
mock_get.side_effect = requests.exceptions.RequestException("Simulated Error")
147-
response = self.url_open("/web_iconify_proxy/mdi/home.svg")
148-
self.assertEqual(response.status_code, 404) # Expect 404 Not Found
136+
with self.assertLogs(level="ERROR") as log:
137+
response = self.url_open("/web_iconify_proxy/mdi/home.svg")
138+
self.assertEqual(response.status_code, 404) # Expect 404 Not Found
139+
self.assertIn("Simulated Error", log.output[0])

0 commit comments

Comments
 (0)