Files
suite/delivery_partner_fedex/tests/test_fedex_account.py
Leighton Pennicott b9fb8ead7b [MIG] delivery_partner_fedex: migrate delivery_partner_fedex from 12.0 to 13.0
Migrate delivery_partner_fedex from 12.0 to 13.0 and write tests for the validation

H4409
2020-11-05 16:32:00 -05:00

30 lines
1.1 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_fedex_account_information(self):
# Create object and confirm that validation error raises if fedex account is blank or not 8 digits
with self.assertRaises(ValidationError):
wrong_account_number = self.PartnerShippingAccount.create({
'name': '12345678',
'description': 'Error Account',
'partner_id': 5,
'delivery_type': 'fedex',
'note': 'This is a note'
})
with self.assertRaises(ValidationError):
no_account_number = self.PartnerShippingAccount.create({
'name': '',
'description': 'Error Account',
'partner_id': 5,
'delivery_type': 'fedex',
'note': 'This is a note'
})