'Neither pickling nor unpickling a QuerySet.query with an __in=inner_qs
lookup should evaluate inner_qs.'

def test_in_lookup_queryset_evaluation(self):

    events = Event.objects.filter(group__in=Group.objects.all())
    with self.assertNumQueries(0):
        dumped = pickle.dumps(events.query)
    with self.assertNumQueries(0):
        reloaded = pickle.loads(dumped)
        reloaded_events = Event.objects.none()
        reloaded_events.query = reloaded
    self.assertSequenceEqual(reloaded_events, [self.e1])
