django seemed to do exactly that old, new, old pattern (I stepped it
through the debugger to confirm) ```group1.has_user(object1) => true ...
group2.add_user(object2) ... group2.has_user(object1) => False``` where
```object1.user_id == object1.user_id```


On Fri, Jan 3, 2014 at 11:44 AM, Calen Pennington
<notifications@github.com>wrote:

> In common/djangoapps/student/roles.py:
>
> >              return False
> >
> > -        if not hasattr(user, '_groups'):
>
> The majority of the time, the caching is just being done on request.user,
> which is a single object. I'm not sure I follow why your tests were
> failing, since the cache is just that, a cache. If you use a new user
> object, you should get the same thing as the older cached object (although
> I guess if you look at an older user object after updating it, then I could
> see you running into a problem).
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-platform/pull/2064/files#r8638230>
> .
>