I wanted to remove it too, because now it is basically checking that the foreign keys of Postgres are working. I would not have written this test in the first place. However, since it was already there, I kept it. It has at least an advantage: if somebody in a future refactoring will forget a foreign key, it will break. It was useful to me, because I actually forgot to add one of the foreign keys in one of the the dmg_dist tables and the test saved my ass, so I want to keep it. But perhaps I should add a comment.