Fix unit tests to match new repository and DAO behaviors.

There's certainly room for improvement in these tests in general, but this should do for now.