+ 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