Skip to content

Commit

Permalink
Wrong attribute name for the shipping line builder
Browse files Browse the repository at this point in the history
Fixes #112
  • Loading branch information
guewen authored and chiragrajkotiya committed Jul 4, 2015
1 parent 58875df commit 713f31f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions magentoerpconnect/tests/test_sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,30 @@ def test_import_guest_order(self):
partner_binding = binding.partner_id.magento_bind_ids
self.assertEqual(partner_binding.magento_id, 'guestorder:900000700')
self.assertTrue(partner_binding.guest_customer)

def test_import_carrier_product(self):
""" Product of a carrier is used in the sale line """
product = self.env['product.product'].create({
'name': 'Carrier Product',
})
self.env['delivery.carrier'].create({
'name': 'Flatrate',
'partner_id': self.env.ref('base.main_partner').id,
'product_id': product.id,
'magento_code': 'flatrate_flatrate',
'magento_carrier_code': 'flatrate_flatrate',
})
binding = self._import_sale_order(900000691)
# check if we have a line with the carrier product,
# which is the shipping line
shipping_line = False
for line in binding.order_line:
if line.product_id == product:
shipping_line = True
self.assertTrue(shipping_line,
msg='No shipping line with the product of the carrier '
'has been found. Line names: %s' %
(', '.join("%s (%s)" % (line.name,
line.product_id.name)
for line
in binding.order_line),))

0 comments on commit 713f31f

Please sign in to comment.