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
mgodseymgodsey 

Assigning a territory to a test user in unit test

I'm writing a unit test where I need to assign a territory to a test user. However, DML is not allowed on the UserTerritory object. Is my only option to query for an actual user in the database?
mgodseymgodsey
also, if DML is not allowed, why does it say that the UserTerritory is creatable? how is creat() different than insert()?

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_userterritory.htm