Don't rely on fixed ids in tests

Creating a new object in an empty db may always give id 1 in sqlite, but
in other databases, there is no guarantee for that.