'Asserts the data model around RegistrationCodeRedemption'

def test_regcode_redemptions(self):

    self.cart.order_type = 'business'
    self.cart.save()
    CourseRegCodeItem.add_to_order(self.cart, self.course_key, 2)
    self.cart.purchase()
    reg_code = CourseRegistrationCode.order_generated_registration_codes(self.course_key)[0]
    enrollment = CourseEnrollment.enroll(self.user, self.course_key)
    redemption = RegistrationCodeRedemption(registration_code=reg_code, redeemed_by=self.user, course_enrollment=enrollment)
    redemption.save()
    test_redemption = RegistrationCodeRedemption.registration_code_used_for_enrollment(enrollment)
    self.assertEqual(test_redemption.id, redemption.id)
