Files
suite/delivery_partner_dhl/tests/test_dhl_account.py
Leighton Pennicott 69a05508b9 [MIG] delivery_partner_dhl: migrate module from 12.0 to 13.0
Migrate delivery_partner_dhl from 12.0 to 13.0 and write tests for the validation error

H4409
2020-11-05 16:24:38 -05:00

29 lines
1.0 KiB
Python

from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
class TestAccount(TransactionCase):
def setUp(self):
super(TestAccount, self).setUp()
self.PartnerShippingAccount = self.env['partner.shipping.account']
def test_dhl_account_information(self):
# Create object and confirm
with self.assertRaises(ValidationError):
wrong_account_number = self.PartnerShippingAccount.create({
'name': '1234567',
'description': 'Error Account',
'partner_id': 5,
'delivery_type': 'dhl',
'note': 'This is a note'
})
with self.assertRaises(ValidationError):
no_account_number = self.PartnerShippingAccount.create({
'name': '',
'description': 'Error Account',
'partner_id': 5,
'delivery_type': 'dhl',
'note': 'This is a note'
})