Add tests for violation of unique constraints