'This tests the rebinding a descriptor to a student does not result
in overly nested _field_data.'

@override_settings(FIELD_OVERRIDE_PROVIDERS=('courseware.student_field_overrides.IndividualStudentOverrideProvider',))
def test_rebind_different_users(self):

    request = self.request_factory.get('')
    request.user = self.mock_user
    course = CourseFactory.create()
    descriptor = ItemFactory(category='html', parent=course)
    field_data_cache = FieldDataCache([course, descriptor], course.id, self.mock_user)
    original_field_data = descriptor._field_data
    render.get_module_for_descriptor(self.mock_user, request, descriptor, field_data_cache, course.id, course=course)
    self.assertIs(descriptor._unwrapped_field_data, original_field_data)
    self.assertIsNot(descriptor._unwrapped_field_data, descriptor._field_data)
    for user in [UserFactory(), UserFactory(), UserFactory()]:
        render.get_module_for_descriptor(user, request, descriptor, field_data_cache, course.id, course=course)
    self.assertIsInstance(descriptor._field_data, LmsFieldData)
    self.assertIsInstance(descriptor._field_data._authored_data._source, OverrideFieldData)
    self.assertIs(descriptor._field_data._authored_data._source.fallback, descriptor._unwrapped_field_data)
