I'm working in an old Salesforce.
In accounts, they have a lot of records, and a validation rule that verifies if a check box is selected and a lookup is null.
The rule was created on 2015/01/01.
The problem is that when i tried to update some accounts there are some of them created before 2015/01/01 that do not satisfy the validation rule.
I created a batch to deselect the check box of the accounts with this issue.
The batch works without problem, but the unit-test for the batch don't allow me to insert an account with the check box selected and a lookup at null.
My solution was insert a record with the check box deselect in test class, and adding if(Test.isRunningTest()) to the start method of the batch with another query to reach the execute method.
My question is, can I deactivate a validation rule for a test method and how? and, if I can not deactivate a validation rule, are there a better solution for this problem?
EDITED: We can not create, edit, delete or deactivate any validation rule, or edit the object in production.