Commit fe5e2b35 by Julia Hansbrough

Refunding CertificateItem now marks parent Order refunded as well

parent 3f0f7fa3
......@@ -422,6 +422,8 @@ class CertificateItem(OrderItem):
return
target_cert.status = 'refunded'
target_cert.save()
target_cert.order.status = 'refunded'
target_cert.order.save()
order_number = target_cert.order_id
# send billing an email so they can handle refunding
......
......@@ -373,6 +373,7 @@ class CertificateItemTest(ModuleStoreTestCase):
CourseEnrollment.unenroll(self.user, self.course_id)
target_certs = CertificateItem.objects.filter(course_id=self.course_id, user_id=self.user, status='refunded', mode='verified')
self.assertTrue(target_certs[0])
self.assertEquals(target_certs[0].order.status, 'refunded')
def test_refund_cert_callback_before_expiration(self):
# If the expiration date has not yet passed on a verified mode, the user can be refunded
......@@ -395,6 +396,7 @@ class CertificateItemTest(ModuleStoreTestCase):
CourseEnrollment.unenroll(self.user, course_id)
target_certs = CertificateItem.objects.filter(course_id=course_id, user_id=self.user, status='refunded', mode='verified')
self.assertTrue(target_certs[0])
self.assertEquals(target_certs[0].order.status, 'refunded')
@patch('shoppingcart.models.log.error')
def test_refund_cert_callback_before_expiration_email_error(self, error_logger):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment