Browse Source

[FIX] base_location_geonames_import: fix test redefining builtin zip

12.0
Stephan Keller 5 years ago
parent
commit
444a32c660
  1. 8
      base_location_geonames_import/tests/test_base_location_geonames_import.py

8
base_location_geonames_import/tests/test_base_location_geonames_import.py

@ -81,10 +81,10 @@ class TestBaseLocationGeonamesImport(common.SavepointCase):
def test_import_title(self): def test_import_title(self):
self.wizard.letter_case = 'title' self.wizard.letter_case = 'title'
self.wizard.with_context(max_import=1).run_import() self.wizard.with_context(max_import=1).run_import()
zip = self.env['res.city.zip'].search(
zip_entry = self.env['res.city.zip'].search(
[('city_id.country_id', '=', self.country.id)], limit=1 [('city_id.country_id', '=', self.country.id)], limit=1
) )
self.assertEqual(zip.city_id.name, zip.city_id.name.title())
self.assertEqual(zip_entry.city_id.name, zip_entry.city_id.name.title())
city = self.env['res.city'].search( city = self.env['res.city'].search(
[('country_id', '=', self.country.id)], limit=1 [('country_id', '=', self.country.id)], limit=1
@ -94,10 +94,10 @@ class TestBaseLocationGeonamesImport(common.SavepointCase):
def test_import_upper(self): def test_import_upper(self):
self.wizard.letter_case = 'upper' self.wizard.letter_case = 'upper'
self.wizard.with_context(max_import=1).run_import() self.wizard.with_context(max_import=1).run_import()
zip = self.env['res.city.zip'].search(
zip_entry = self.env['res.city.zip'].search(
[('city_id.country_id', '=', self.country.id)], limit=1 [('city_id.country_id', '=', self.country.id)], limit=1
) )
self.assertEqual(zip.city_id.name, zip.city_id.name.upper())
self.assertEqual(zip_entry.city_id.name, zip_entry.city_id.name.upper())
city = self.env['res.city'].search( city = self.env['res.city'].search(
[('country_id', '=', self.country.id)], limit=1 [('country_id', '=', self.country.id)], limit=1

Loading…
Cancel
Save