Handle alternative IntegrityError message

The message on the IntegrityError raised when attempting to save
a duplicate item differs between the local env and TravisCI.