'Test that a model which has different primary key for the parent model
passes unique field checking correctly. Refs #17615.'

def test_inherited_unique_field_with_form(self):

    class ProfileForm(forms.ModelForm, ):
        class Meta:
            model = Profile
            fields = u'__all__'
    User.objects.create(username=u'user_only')
    p = Profile.objects.create(username=u'user_with_profile')
    form = ProfileForm({u'username': u'user_with_profile', u'extra': u'hello'}, instance=p)
    self.assertTrue(form.is_valid())
