def test_inline_model_with_to_field(self):
        FormSet = inlineformset_factory(User, UserSite, exclude=('is_superuser',))

        user = User.objects.create(username="guido", serial=1337)
        UserSite.objects.create(user=user, data=10)
        formset = FormSet(instance=user)

        # Testing the inline model's relation
        self.assertEqual(formset[0].instance.user_id, "guido")
#13794 --- An inline model with a to_field of a formset with instance
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/tests/model_formsets_regress/tests.py/InlineFormsetTests.test_inline_model_with_to_field