Add tests for db validation