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

Test which execute two triggers

I want to know if a test method can execute two triggers.

My test class should test a trigger after insert lead but to test this, i should insert account and i have a trigger after insert account too.

I feel that only the first trigger run.

Can you help me to understand ? 


You shouldn't have to insert the account also.  The Lead can be inserted as a stand alone record.  But - if your test class inserts an Account record - then the trigger on the Account object will fire.  If your same test class inserts a Lead record, then the trigger on the lead will also fire.