Add tests requiring error handling to prevent primary key errors