Add test for deleting duplicate candidates

This is related to #247