Fixed duplicate code
Merge pull request #222 from fabien/fix/relation-tests

Fixed duplicate code