Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit fe60bfa

Browse files
astirpehbrunn
authored andcommittedOct 18, 2018
Adapt tests of l10n_nl_postcodeapi to avoid conflicts
1 parent 39fa318 commit fe60bfa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎l10n_nl_postcodeapi/tests/test_l10n_nl_postcodeapi.py

+21
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@
77

88
class TestNlPostcodeapi(TransactionCase):
99

10+
def setUp(self):
11+
super(TestNlPostcodeapi, self).setUp()
12+
13+
# this block of code removes the existing provinces
14+
# eventually already created by module l10n_nl_country_states
15+
# to avoid conflicts with tests of l10n_nl_country_states
16+
is_l10n_nl_country_states_installed = self.env['ir.model']._get(
17+
'res.country.state.nl.zip'
18+
)
19+
if is_l10n_nl_country_states_installed:
20+
NlZipStateModel = self.env['res.country.state.nl.zip']
21+
NlZipStateModel.search([]).unlink()
22+
country_nl = self.env['res.country'].search([
23+
('code', 'like', 'NL')
24+
], limit=1)
25+
self.assertTrue(country_nl)
26+
states = self.env['res.country.state'].search([
27+
('country_id', '=', country_nl.id)
28+
])
29+
states.unlink()
30+
1031
def load_nl_provinces(self):
1132
csv_resource = get_module_resource(
1233
'l10n_nl_postcodeapi',

0 commit comments

Comments
 (0)