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
S GogatiS Gogati 

How to skip the validation rules when inserting records in test class

Hi All,

     We have an package, while excuting the testclass at customer end, due to custom validations few test class are failing. Do we have any mechanism  to skip validation rules in apex test class.


Thanks in Advance
AshlekhAshlekh
Hi,

You cann't bypass the validataion rule in test class. Why you want to do  this becuase in test class we always create data according to real senieiro.

-Thanks
Ashlekh Gera 
S GogatiS Gogati
Thanks for responding, Here our package is common for all customers. so we doesn't know what validations they are having.
AshlekhAshlekh
Hi,

Yes it is a big problem here is a idea for this.

https://success.salesforce.com/ideaview?id=08730000000BrpCAAS

-Thanks
Ashlekh Gera