I know the field is not editable but I mean by associating a User record with a Contact/Person Account record in your test data, somehow it gets enabled? Do you know?
The reason I need this ability is to be able to test some custom merge functionality where one of the two person accounts being merged have a Community user associated with it and depending on which one has the user to it, determines how the merge occurs. I would hate having to have to use
Test.isRunningTest() to bypass this.
EDIT: I guess, another way of asking this question is, is there a programmatic way of "Enable Community User" button on Person Accounts / Contacts