[FIX] test_http: unreliable tests

Part-of: odoo/odoo#91927
This commit is contained in:
Julien Castiaux
2022-05-23 08:29:55 +02:00
committed by Christophe Monniez
parent d2b7a601ba
commit 8f52bdf9f4
+3 -1
View File
@@ -1,5 +1,6 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import html
import json
from unittest.mock import patch
from urllib.parse import urlparse
@@ -380,7 +381,7 @@ class TestHttpModels(TestHttpBase):
milky_way = self.env.ref('test_http.milky_way')
res = self.url_open(f'/test_http/{milky_way.id}/9999') # unknown gate
self.assertEqual(res.status_code, 400)
self.assertIn("The goa'uld destroyed the gate", res.text)
self.assertIn("The goa'uld destroyed the gate", html.unescape(res.text))
@tagged('post_install', '-at_install')
@@ -510,6 +511,7 @@ class TestHttpEnsureDb(TestHttpBase):
self.assertEqual(new_session.uid, None)
# follow redirection
self.opener.cookies['session_id'] = new_session.sid
res = self.multidb_url_open('/test_http/ensure_db')
res.raise_for_status()
self.assertEqual(res.status_code, 200)