class TestGetInvoiceInfo(object): def setup(self): mock_destination_log() mock_upc_log() self.test_inv = Invoice(invoice_number='59128', customer='Saks Fifth Avenue', store_number='0689', store_name='', dc_number='0385', discount_code='05', discount=0, total_cost=4575.0, total_qty=7) self.test_inv_mult = Invoice(invoice_number='65502', customer="Bloomingdale's", store_number='0011', store_name='CHESTNUT HILL', dc_number='SF', discount_code='05', discount=0, total_cost=1570.0, total_qty=2) item = Item(upc='8032762282181', style='OB1403-MPB-Y-02-0.0', cost=785.0, qty=2) self.test_inv_mult.items.append(item) def test_get_invoice_info(self): invoice_list = get_invoice_info([Invoice(invoice_number='59128', customer='Saks Fifth Avenue')], 'Saks Fifth Avenue', mock_settings()) inv = invoice_list[0] assert inv.__repr__() == self.test_inv.__repr__() def test_multiple_items(self): invoice_list = get_invoice_info([Invoice(invoice_number='65502', customer="Bloomingdale's")], "Bloomingdale's", mock_settings()) inv = invoice_list[0] for index, item in enumerate(self.test_inv_mult.items): assert item.__repr__() == inv.items[index].__repr__() assert inv.__repr__() == self.test_inv_mult.__repr__()
class TestGetInvoiceInfo(object): def setup(self): mock_destination_log() mock_upc_log() self.test_inv = Invoice(invoice_number='59128', customer='Saks Fifth Avenue', store_number='0689', store_name='', dc_number='0385', discount_code='05', discount=0, total_cost=4575.0, total_qty=7) self.test_inv_mult = Invoice(invoice_number='65502', customer="Bloomingdale's", store_number='0011', store_name='CHESTNUT HILL', dc_number='SF', discount_code='05', discount=0, total_cost=1570.0, total_qty=2) item = Item(upc='8032762282181', style='OB1403-MPB-Y-02-0.0', cost=785.0, qty=2) self.test_inv_mult.items.append(item) def test_get_invoice_info(self): invoice_list = get_invoice_info( [Invoice(invoice_number='59128', customer='Saks Fifth Avenue')], 'Saks Fifth Avenue', mock_settings()) inv = invoice_list[0] assert inv.__repr__() == self.test_inv.__repr__() def test_multiple_items(self): invoice_list = get_invoice_info( [Invoice(invoice_number='65502', customer="Bloomingdale's")], "Bloomingdale's", mock_settings()) inv = invoice_list[0] for index, item in enumerate(self.test_inv_mult.items): assert item.__repr__() == inv.items[index].__repr__() assert inv.__repr__() == self.test_inv_mult.__repr__()
class TestGetShippingInfo(object): def setup(self): self.test_invoice = Invoice(invoice_number='59128', customer='Saks Fifth Avenue', sscc_number='803276200000591289', tracking_number='1ZW885Y21349335867', ship_date=datetime(2015, 12, 15), address_1='ONE WALDENBOOKS DRIVE', address_2='DC# 185 STORE# 689', city_state_zip='LA VERGNE, TN 37086') def test_get_shipping_info(self): invoice_list = get_shipping_info( [Invoice(invoice_number='59128', customer='Saks Fifth Avenue')], mock_settings()) assert invoice_list[0].__repr__() == self.test_invoice.__repr__()
class TestGetShippingInfo(object): def setup(self): self.test_invoice = Invoice(invoice_number='59128', customer='Saks Fifth Avenue', sscc_number='803276200000591289', tracking_number='1ZW885Y21349335867', ship_date=datetime(2015, 12, 15), address_1='ONE WALDENBOOKS DRIVE', address_2='DC# 185 STORE# 689', city_state_zip='LA VERGNE, TN 37086') def test_get_shipping_info(self): invoice_list = get_shipping_info([Invoice(invoice_number='59128', customer='Saks Fifth Avenue')], mock_settings()) assert invoice_list[0].__repr__() == self.test_invoice.__repr__()