Ah, yes. I would expect that behavior exactly. `has_user(object1)` sets `object1._groups`, `add_user(object2)` sets/updates `object2._groups`, and then `has_user(object1)` checks the earlier cached copy.

In real usage, this pattern is unlikely. In unit tests, you could work around it by always using the same object, or by always using a new object.