I would really like to stop using raw sql for these tests; for reports, I created a testutils/reports namespace where I could just call into our normal query functions to retrieve reports.  I think it would be a good idea to have a similar thing for nodes; it'd make our tests both more thorough and more future-proof.

That said, I don't know that it's critical enough to block getting this merged in.  There will still be a bunch of raw SQL in this test even if you do that.  But, we gotta start somewhere :)  Your call.