def test_full_cache(self):
        demo_result = Mock()
        self.mockcache.get.return_value = demo_result

        user = self.create_user()
        backend = CachedModelAuthBackend()
        result = backend.get_all_permissions(user)

        self.mockcache.get.assert_called_once_with(
            user.cache_key + '_permissions')
        self.assertEqual(user._perm_cache, demo_result)
        self.assertEqual(result, demo_result)
Test where the cache is full and should be returned
dataset/ETHPy150Open ofa/connect/open_connect/connect_core/tests/test_utils_auth_backends.py/TestCachedModelAuthBackend.test_full_cache