Test for applying query methods to associations