'Asserts the data model around RegistrationCodeRedemption and
what happens when we do multiple redemptions by same user'

def test_regcode_multi_redemptions(self):

    self.cart.order_type = 'business'
    self.cart.save()
    CourseRegCodeItem.add_to_order(self.cart, self.course_key, 2)
    self.cart.purchase()
    reg_codes = CourseRegistrationCode.order_generated_registration_codes(self.course_key)
    self.assertEqual(len(reg_codes), 2)
    enrollment = CourseEnrollment.enroll(self.user, self.course_key)
    ids = []
    for reg_code in reg_codes:
        redemption = RegistrationCodeRedemption(registration_code=reg_code, redeemed_by=self.user, course_enrollment=enrollment)
        redemption.save()
        ids.append(redemption.id)
    test_redemption = RegistrationCodeRedemption.registration_code_used_for_enrollment(enrollment)
    self.assertIn(test_redemption.id, ids)
