Reworking database tests