Implement foreign key tests