'Fixtures.'

def setUp(self):

    super(TestCourseRegistrationCodes, self).setUp()
    CourseModeFactory.create(course_id=self.course.id, min_price=50)
    self.instructor = InstructorFactory(course_key=self.course.id)
    self.client.login(username=self.instructor.username, password='test')
    CourseSalesAdminRole(self.course.id).add_users(self.instructor)
    data = {'total_registration_codes': 12, 'company_name': 'Test    Group', 'company_contact_name': 'Test@company.com', 'company_contact_email': 'Test@company.com', 'unit_price': 122.45, 'recipient_name': 'Test123', 'recipient_email': 'test@123.com', 'address_line_1': 'Portland    Street', 'address_line_2': '', 'address_line_3': '', 'city': '', 'state': '', 'zip': '', 'country': '', 'customer_reference_number': '123A23F', 'internal_reference': '', 'invoice': ''}
    response = self.client.post(self.url, data, **{'HTTP_HOST': 'localhost'})
    self.assertEqual(response.status_code, 200, response.content)
    for i in range(5):
        order = Order(user=self.instructor, status='purchased')
        order.save()
    for i in range(5):
        i += 1
        registration_code_redemption = RegistrationCodeRedemption(registration_code_id=i, redeemed_by=self.instructor)
        registration_code_redemption.save()
