function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kzmpkzmp 

How to write unit tests for a package and account for customizations of users environments

Hi,

I have a managed package which includes triggers and other bits of code which work with sObjects.

In my unit tests for the package I do inserts in say the Accounts sObject. But when a user who has customized the the Accounts sObject with validation rules tries to install my package he/she gets an error because the values my tests insert do not pass his/her validation rules.

 

Could you please advise of the best practices in this kind of situation.

 

Thanks,

Kzmp