Add test for index not found error.
Raise if the unique index used doesn't exist.