We prove the test function conjecture of Kottwitz and the first named author for local models of Shimura varieties with parahoric level structure, and their analogues in equal characteristic.