Better integration testing of upsert behaviour