We have test classes that are failing when we try to insert a portal user. Error: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, To create or update users for this profile, go to Setup > Communities Settings and select Allow using standard external profiles for self-registration and user creation.: [ProfileId]
Is there a way to create a portal user in the test class without enabling this feature. As a best practice Salesforce recommends not to turn on this feature. ("allow using standard external profiles for self registration and user creation") we dont want to either just for fixing test classes.