Add test for full_address with country and subdivision
issue6412 review38281002
This commit is contained in:
1 parent
44ef1c7eb8
commit
d1645b44e3
1 file changed
+25
@@ -103,6 +103,31 @@ class PartyTestCase(ModuleTestCase):
|
||||
"St sample, 15\n"
|
||||
"City")
|
||||
|
||||
@with_transaction()
|
||||
def test_full_address_country_subdivision(self):
|
||||
'Test full address with country and subdivision'
|
||||
pool = Pool()
|
||||
Party = pool.get('party.party')
|
||||
Country = pool.get('country.country')
|
||||
Subdivision = pool.get('country.subdivision')
|
||||
Address = pool.get('party.address')
|
||||
party, = Party.create([{
|
||||
'name': 'Party',
|
||||
}])
|
||||
country = Country(name='Country')
|
||||
country.save()
|
||||
subdivision = Subdivision(
|
||||
name='Subdivision', country=country, code='SUB', type='area')
|
||||
subdivision.save()
|
||||
address, = Address.create([{
|
||||
'party': party.id,
|
||||
'subdivision': subdivision.id,
|
||||
'country': country.id,
|
||||
}])
|
||||
self.assertMultiLineEqual(address.full_address,
|
||||
"Subdivision\n"
|
||||
"COUNTRY")
|
||||
|
||||
@with_transaction()
|
||||
def test_party_label_report(self):
|
||||
'Test party label report'
|
||||
|
||||
Reference in new issue
Block a user