How to avoid MIXED_DML_OPERATION error in Salesforce tests that create Users
Not many Salesforce people on here yet, I guess. I found a solution, I don’t know why it works, but it works. All parts of the test that access normal objects need to be wrapped in a System.runAs that explicitly uses the current user, like this: User thisUser = [ select Id from User where … Read more