'Test on an actual model, based on the report in #25426.'

def test_pickle_model(self):

    category = Category.objects.create(name='thing1')
    CategoryInfo.objects.create(category=category)
    for protocol in range((pickle.HIGHEST_PROTOCOL + 1)):
        lazy_category = SimpleLazyObject((lambda : category))
        lazy_category.categoryinfo
        lazy_category_2 = SimpleLazyObject((lambda : category))
        with warnings.catch_warnings(record=True) as recorded:
            self.assertEqual(pickle.loads(pickle.dumps(lazy_category, protocol)), category)
            self.assertEqual(pickle.loads(pickle.dumps(lazy_category_2, protocol)), category)
            self.assertEqual(len(recorded), 0)
