The fan is controlled by the temperature sensor and a small control box inside the vehicle. Whenever you turn the key off, a ~20 minute timer is started inside the control box. If the temperature sensor exceeds the threshold (212°F), it grounds out the wire. The control box will see that the wire has been grounded, and turn the fan on.
It will then run the fan for about 20 minutes, or until the temperature switch drops below the threshold and opens back up. Whichever occurs first.
So to test, you need to briefly run the engine to "set" the timer, and then you can test it by grounding out that sensor.
Note: The fan will only activate if the key is off.