There are a great many ways to validate for a specific user, and I would say those are most appropriate here as well. Simply check the following in your rule:
Then, run your test as a
User who has this permission assigned. You will need to add the
Custom Permission to a
Permission Set, then make sure this context user has it assigned.
Id permissionSetId = [
SELECT Id FROM PermissionSet WHERE Name = 'SkipOpportunityValidations'
User contextUser = (User)SObjectFactory.create(User.sObjectType);
PermissionSetAssignment assignment = new PermissionSetAssignemnt(
// validations will now be skipped