def test_bad_cache(self):
"""The RATELIMIT_USE_CACHE setting works if the cache exists."""
self.skipTest('I do not know why this fails when the other works.')
class BadCacheView(RatelimitMixin, View):
ratelimit_key = 'ip'
def post(self, request, *args, **kwargs):
return request
get = post
view = BadCacheView.as_view()
req = rf.post('/')
with self.assertRaises(InvalidCacheBackendError):
view(req)
评论列表
文章目录