Skip to main content
Test data isolation

Ensure that test methods create their own data and don't access actual data in your org.

Lorenzo Frattini avatar
Written by Lorenzo Frattini
Updated over 6 years ago

Rationale

As a best practice, tests should always be isolated and create their own data. Accessing the org data for unit tests, using the annotation @IsTest(seeAllData=true), should be avoided.

Scope

  • Apex test classes

  • Apex test methods

See also

Did this answer your question?