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
PrasadVRPrasadVR 

how to get soql query only test class data

Hi All ,

I have test class where I am providing all the required data when I run the test class , my soql query in class is fetching the data from database instead of test class 

How to avoid this ? and how to get my quey only test class data 
desmoquattrodesmoquattro
You may have the @SeeAllData annotation somewhere in your test class, which allows that method or class to see the data in your org. Check out the annotation documentaiton here:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_annotation_isTest.htm
Abhi_TripathiAbhi_Tripathi
Hi,

Use @isTest(seeAllData = False)

the above code will restric your query to fetch records from data base,

for test class you can refer this post
http://abhithetechknight.blogspot.in/2013/10/salesforce-test-class-basics.html