'Verify the donation fields and that the donation can be purchased.'

def _assert_donation(self, donation, donation_type=None, course_id=None, unit_cost=None, line_desc=None):

    self.assertEqual(donation.order, self.cart)
    self.assertEqual(donation.user, self.user)
    self.assertEqual(donation.donation_type, donation_type)
    self.assertEqual(donation.course_id, course_id)
    self.assertEqual(donation.qty, 1)
    self.assertEqual(donation.unit_cost, unit_cost)
    self.assertEqual(donation.currency, 'usd')
    self.assertEqual(donation.line_desc, line_desc)
    self.assertTrue(self.cart.has_items(item_type=Donation))
    self.assertEqual(self.cart.total_cost, unit_cost)
    self.cart.start_purchase()
    self.cart.purchase()
    donation = Donation.objects.get(pk=donation.id)
    self.assertEqual(donation.status, 'purchased')
