Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [seealldata]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
31 views

What is the proper way to enable SeeAllData when working with Event Monitoring Big Objects?

I'm using Event Monitoring & would like to use @SeAllData = true in my unit tests, so that I can leverage pre-existing logs. However, when I enable it & query an Event Monitoring object, I ...
0
votes
1answer
47 views

How to use SeeAllData = True method inside a test class with SeeAllData = False

I have written a test class where I need to insert Survey Invitation record, for which Survey required (i.e. Survey is parent and Survey invitation is child). I'm querying the Survey record since ...
5
votes
1answer
307 views

When should I use SeeAllData=true in my test methods?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
1
vote
3answers
127 views

Is it necessary to SeeAllData in this case? Thoughts on Best Practice?

There's a lot of talk about SeeAllData being something to always avoid for best practice. My understanding is, if you're using it to test, for example, a Contact Trigger on a specific Contact, this is ...
1
vote
2answers
204 views

Test fails in destination Org with System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE

I've a test class for a controller which passes in the development Org but not in the destination/sandbox. Here's the error I get System.DmlException: Insert failed. First exception on row 0; first ...
0
votes
1answer
49 views

Query returning value from database and not test class

I'm having trouble with my code coverage and have a couple of hypothesis why this could be. My class: public class Tareas_Ordenador { public static void Ordenar(){ User Usuario = [Select Id ...
0
votes
1answer
116 views

Potential usecase for SeeAllData = true

As current api set default test class with SeeAllData=false and is advisable for us to use sample data,I am wondering what is ideal case for SeeAllData=true. I am planning to write test class that ...
3
votes
2answers
2k views

why need seeAllData = true in test class when use connectAPI

In my controller i'm using connectApi and my class functionality is working fine but the issue is when i'm using in my Test class (SeeAllData=true) it's covered 100% but seeAllData = true is not ...
0
votes
1answer
1k views

How to use Test.getStandardPricebookId for classes that automaticaly sync quotes

I was hopping to be able to remove the @seeAllData annotation from my tests by using Summer'14's addition - Test.getStandardPricebookId() but the test are failing with this error: System....
3
votes
1answer
425 views

How to avoid hard coding Id into a class?

I am running my test class but keep getting thrown this error INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY I have even added seealldata=true to try overcome this but want a more clean solution my ...
4
votes
1answer
828 views

SOQL returning org data in test class. Not using isTest(SeeAllData=true)

A method in my class I'm testing is suppose to return all users in the org, plus an extra user empty user at the beginning of the list. The reason for this is I wanted the default to be empty. @...
41
votes
4answers
1k views

Why Are Data Silos Important in Unit Tests?

I have a lot of strong opinions about this issue, but had a hard time finding official documents today to back up my position. A lot of times we say it is bad practice to use seeAllData=true, but we ...