|
|
@ -21,7 +21,7 @@ class TestBaseLocationGeonamesImport(common.TransactionCase): |
|
|
|
('country_id', '=', self.country.id) |
|
|
|
]) |
|
|
|
self.assertTrue(state_count) |
|
|
|
# Look if the are imported zips |
|
|
|
# Look if there are imported zips |
|
|
|
zip_count = self.env['res.better.zip'].search_count([ |
|
|
|
('country_id', '=', self.country.id) |
|
|
|
]) |
|
|
@ -44,3 +44,19 @@ class TestBaseLocationGeonamesImport(common.TransactionCase): |
|
|
|
}) |
|
|
|
self.wizard.run_import() |
|
|
|
self.assertFalse(zip_entry.exists()) |
|
|
|
|
|
|
|
def test_import_title(self): |
|
|
|
self.wizard.letter_case = 'title' |
|
|
|
self.wizard.with_context(max_import=1).run_import() |
|
|
|
zip = self.env['res.better.zip'].search( |
|
|
|
[('country_id', '=', self.country.id)], limit=1 |
|
|
|
) |
|
|
|
self.assertEqual(zip.city, zip.city.title()) |
|
|
|
|
|
|
|
def test_import_upper(self): |
|
|
|
self.wizard.letter_case = 'upper' |
|
|
|
self.wizard.with_context(max_import=1).run_import() |
|
|
|
zip = self.env['res.better.zip'].search( |
|
|
|
[('country_id', '=', self.country.id)], limit=1 |
|
|
|
) |
|
|
|
self.assertEqual(zip.city, zip.city.upper()) |