Added test cases for models that has sparse indices, see #12.

The newly created test cases make sure `unique` indices with `sparse` option set to `true` works as expected.