'Test Order Sales Report CSV'

def test_sale_order_features_without_discount(self):

    query_features = [('id', 'Order    Id'), ('company_name', 'Company    Name'), ('company_contact_name', 'Company    Contact    Name'), ('company_contact_email', 'Company    Contact    Email'), ('total_amount', 'Total    Amount'), ('total_codes', 'Total    Codes'), ('total_used_codes', 'Total    Used    Codes'), ('logged_in_username', 'Login    Username'), ('logged_in_email', 'Login    User    Email'), ('purchase_time', 'Date    of    Sale'), ('customer_reference_number', 'Customer    Reference    Number'), ('recipient_name', 'Recipient    Name'), ('recipient_email', 'Recipient    Email'), ('bill_to_street1', 'Street    1'), ('bill_to_street2', 'Street    2'), ('bill_to_city', 'City'), ('bill_to_state', 'State'), ('bill_to_postalcode', 'Postal    Code'), ('bill_to_country', 'Country'), ('order_type', 'Order    Type'), ('status', 'Order    Item    Status'), ('coupon_code', 'Coupon    Code'), ('unit_cost', 'Unit    Price'), ('list_price', 'List    Price'), ('codes', 'Registration    Codes'), ('course_id', 'Course    Id'), ('quantity', 'Quantity'), ('total_discount', 'Total    Discount'), ('total_amount', 'Total    Amount    Paid')]
    order = Order.get_cart_for_user(self.instructor)
    order.order_type = 'business'
    order.save()
    order.add_billing_details(company_name='Test    Company', company_contact_name='Test', company_contact_email='test@123', recipient_name='R1', recipient_email='', customer_reference_number='PO#23')
    CourseRegCodeItem.add_to_order(order, self.course.id, 4)
    order.purchase()
    item = order.orderitem_set.all().select_subclasses()[0]
    db_columns = [x[0] for x in query_features]
    sale_order_records_list = sale_order_record_features(self.course.id, db_columns)
    for sale_order_record in sale_order_records_list:
        self.assertEqual(sale_order_record['recipient_email'], order.recipient_email)
        self.assertEqual(sale_order_record['recipient_name'], order.recipient_name)
        self.assertEqual(sale_order_record['company_name'], order.company_name)
        self.assertEqual(sale_order_record['company_contact_name'], order.company_contact_name)
        self.assertEqual(sale_order_record['company_contact_email'], order.company_contact_email)
        self.assertEqual(sale_order_record['customer_reference_number'], order.customer_reference_number)
        self.assertEqual(sale_order_record['unit_cost'], item.unit_cost)
        self.assertIsNotNone(sale_order_record['list_price'])
        self.assertEqual(sale_order_record['list_price'], item.unit_cost)
        self.assertEqual(sale_order_record['status'], item.status)
        self.assertEqual(sale_order_record['coupon_code'], 'N/A')
        self.assertEqual(sale_order_record['total_amount'], (item.unit_cost * item.qty))
        self.assertEqual(sale_order_record['total_discount'], 0)
        self.assertEqual(sale_order_record['quantity'], item.qty)
