[FIX] payment: move _build_url to the test class that supports it

Calling `_build_url` for a test class that only inherited from
`PaymentCommon` would raise an error, as the method depends on the
`HttpCase` test class that is only inherited by `PaymentHttpCommon`.

closes odoo/odoo#95860

Related: odoo/documentation#2532
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Antoine Vandevenne (anv)
2022-08-17 17:20:50 +02:00
parent 5ac27efc72
commit d104ef0a50
2 changed files with 5 additions and 4 deletions
-4
View File
@@ -4,7 +4,6 @@ import logging
from unittest.mock import patch
from lxml import objectify
from werkzeug import urls
from odoo.fields import Command
from odoo.tools.misc import hmac as hmac_tool
@@ -244,9 +243,6 @@ class PaymentCommon(AccountTestInvoicingCommon):
access_token = hmac_tool(self.env(su=True), 'generate_access_token', token_str)
return access_token
def _build_url(self, route):
return urls.url_join(self.base_url(), route)
def _extract_values_from_html_form(self, html_form):
""" Extract the transaction rendering values from an HTML form.
+5
View File
@@ -2,7 +2,9 @@
import json
from uuid import uuid4
from lxml import etree, objectify
from werkzeug import urls
from odoo.tests import HttpCase
@@ -19,6 +21,9 @@ class PaymentHttpCommon(PaymentCommon, HttpCase):
# Helpers #
###########
def _build_url(self, route):
return urls.url_join(self.base_url(), route)
def _make_http_get_request(self, url, params=None):
""" Make an HTTP GET request to the provided URL.