'Tests record_purchase with good and without returned CCNum'

def test_record_purchase(self):

    student1 = UserFactory()
    student1.save()
    student2 = UserFactory()
    student2.save()
    params_cc = {'card_accountNumber': '1234', 'card_cardType': '001', 'billTo_firstName': student1.first_name}
    params_nocc = {'card_accountNumber': '', 'card_cardType': '002', 'billTo_firstName': student2.first_name}
    order1 = Order.get_cart_for_user(student1)
    order2 = Order.get_cart_for_user(student2)
    record_purchase(params_cc, order1)
    record_purchase(params_nocc, order2)
    self.assertEqual(order1.bill_to_first, student1.first_name)
    self.assertEqual(order1.status, 'purchased')
    order2 = Order.objects.get(user=student2)
    self.assertEqual(order2.bill_to_first, student2.first_name)
    self.assertEqual(order2.status, 'purchased')
