[MIG] delivery_partner_dhl: to Odoo 13.0

This commit is contained in:
Leighton Pennicott
2020-11-06 17:45:34 -05:00
committed by Jared Kipe
parent d029a4288e
commit 2ee084c9ae
3 changed files with 40 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
{
'name': 'DHL Partner Shipping Accounts',
'author': 'Hibou Corp. <hello@hibou.io>',
'version': '12.0.1.0.0',
'version': '13.0.1.0.0',
'category': 'Stock',
'sequence': 95,
'summary': 'DHL Partner Shipping Accounts',

View File

@@ -0,0 +1 @@
from . import test_dhl_account

View File

@@ -0,0 +1,38 @@
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']
self.partner = self.env.ref('base.res_partner_12')
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': self.partner.id,
'delivery_type': 'dhl',
'note': 'This is a note'
})
with self.assertRaises(ValidationError):
no_account_number = self.PartnerShippingAccount.create({
'name': '',
'description': 'Error Account',
'partner_id': self.partner.id,
'delivery_type': 'dhl',
'note': 'This is a note'
})
_ = self.PartnerShippingAccount.create({
'name': '123456789',
'description': 'Success',
'partner_id': self.partner.id,
'delivery_type': 'dhl',
'note': 'This is a note'
})