Repository tests
Schema tests
Improvements to test factory