Skip to content

Commit

Permalink
[FIX] *_location_nuts: backport 13.0 test improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
NL66278 committed Oct 13, 2023
1 parent 42b3494 commit b7e5590
Show file tree
Hide file tree
Showing 6 changed files with 900 additions and 20 deletions.
2 changes: 1 addition & 1 deletion l10n_nl_location_nuts/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import logging

from odoo import api, SUPERUSER_ID
from odoo import SUPERUSER_ID, api

_logger = logging.getLogger(__name__)

Expand Down
7 changes: 3 additions & 4 deletions l10n_nl_location_nuts/i18n/l10n_nl_location_nuts.pot
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_nl_location_nuts
# * l10n_nl_location_nuts
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -17,4 +17,3 @@ msgstr ""
#: model:ir.model,name:l10n_nl_location_nuts.model_nuts_import
msgid "Import NUTS items from European RAMON service"
msgstr ""

22 changes: 22 additions & 0 deletions l10n_nl_location_nuts/i18n/nl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_nl_location_nuts
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-12-13 01:36+0000\n"
"Last-Translator: Bosd <[email protected]>\n"
"Language-Team: none\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.10\n"

#. module: l10n_nl_location_nuts
#: model:ir.model,name:l10n_nl_location_nuts.model_nuts_import
msgid "Import NUTS items from European RAMON service"
msgstr "Importeer NUTS gegevens vanuit Europese RAMON service"
32 changes: 17 additions & 15 deletions l10n_nl_location_nuts/tests/test_l10n_nl_location_nuts.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
# Copyright 2018-2019 Onestein (<https://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import logging
from os.path import dirname, join

from vcr import VCR

from odoo.tests.common import TransactionCase

from ..hooks import post_init_hook

logging.getLogger("vcr").setLevel(logging.WARNING)

recorder = VCR(
record_mode="once",
cassette_library_dir=join(dirname(__file__), "vcr_cassettes"),
path_transformer=VCR.ensure_suffix(".yaml"),
filter_headers=["Authorization"],
)


class TestNlLocationNuts(TransactionCase):
def setUp(self):
super().setUp()

if not self.env["res.country.state"].search(
[
("code", "=", "NB"),
("country_id", "=", self.env.ref("base.nl").id),
]
):
self.env["res.country.state"].create(
{
"name": "Noord-Brabant",
"code": "NB",
"country_id": self.env.ref("base.nl").id,
}
)

importer = self.env["nuts.import"]
importer.run_import()
with recorder.use_cassette("nuts_import"):
importer.run_import()

def test_dutch_nuts(self):
"""
Expand Down
Loading

0 comments on commit b7e5590

Please sign in to comment.