Adding test for whitelisting when locked in model/query.

Shows that #286 has been solved already.