+ Start a Discussion

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?
also, if DML is not allowed, why does it say that the UserTerritory is creatable? how is creat() different than insert()?