I don't like the tests very much, because they test the SQL in such a strict manner. I would rather prefer a functional test for this instead of testing the internal SQL to get there.