'Tests payment_accepted cases with an order'

def test_payment_accepted_order(self):

    student1 = UserFactory()
    student1.save()
    order1 = Order.get_cart_for_user(student1)
    params = {'card_accountNumber': '1234', 'card_cardType': '001', 'billTo_firstName': student1.first_name, 'billTo_lastName': u'\u2603', 'orderNumber': str(order1.id), 'orderCurrency': 'usd', 'decision': 'ACCEPT', 'ccAuthReply_amount': '0.00'}
    params_bad_ordernum = params.copy()
    params_bad_ordernum['orderNumber'] = str((order1.id + 10))
    with self.assertRaises(CCProcessorDataException):
        payment_accepted(params_bad_ordernum)
    params_wrong_type_amt = params.copy()
    params_wrong_type_amt['ccAuthReply_amount'] = 'ab'
    with self.assertRaises(CCProcessorDataException):
        payment_accepted(params_wrong_type_amt)
    params_wrong_amt = params.copy()
    params_wrong_amt['ccAuthReply_amount'] = '1.00'
    with self.assertRaises(CCProcessorWrongAmountException):
        payment_accepted(params_wrong_amt)
    params_not_accepted = params.copy()
    params_not_accepted['decision'] = 'REJECT'
    self.assertFalse(payment_accepted(params_not_accepted)['accepted'])
    self.assertTrue(payment_accepted(params)['accepted'])
