Ejemplo n.º 1
0
 def cache(self):
     """
     Returns an :py:class:`ObjectRelatedCache` object. This behaves equivalent to
     Django's built-in cache backends, but puts you into an isolated environment for
     this event, so you don't have to prefix your cache keys.
     """
     return ObjectRelatedCache(self, field='slug')
Ejemplo n.º 2
0
def test_incorrect_cache_creation():
    with pytest.raises(Exception):
        ObjectRelatedCache(1)