Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(6)  |  Derive(0)  |  Import(4)

src/d/j/django-cache-tools-0.1.1/cache_tools/templatetags/get_group_key.py   django-cache-tools(Download)
from django import template
from cache_tools.tools import get_group_key
 
register = template.Library()
 
    def render(self, context):
        context[self.var_name] = get_group_key(self.group)
        return ''
 
@register.tag("get_group_key")

src/d/j/django-cache-tools-HEAD/cache_tools/templatetags/get_group_key.py   django-cache-tools(Download)
from django import template
from cache_tools.tools import get_group_key
 
register = template.Library()
 
    def render(self, context):
        context[self.var_name] = get_group_key(self.group)
        return ''
 
@register.tag("get_group_key")

src/d/j/django-cache-tools-0.1.1/cache_tools/tests/test_tools.py   django-cache-tools(Download)
from django.test import TestCase
from mock import Mock, MagicMock, patch
from django.test.client import RequestFactory
from cache_tools.tools import cache_page_in_group, get_group_key, expire_cache_group, TIME_TO_CACHE
 
class CachingTest(TestCase):
    def test_get_group_key(self):
        key = get_group_key('test')
    def test_get_group_key(self, cache_get):
        cache_get.return_value = 15
        key = get_group_key('test')
        assert key == 'test15'
 

src/d/j/django-cache-tools-HEAD/cache_tools/tests/test_tools.py   django-cache-tools(Download)
from django.test import TestCase
from mock import Mock, MagicMock, patch
from django.test.client import RequestFactory
from cache_tools.tools import cache_page_in_group, get_group_key, expire_cache_group, TIME_TO_CACHE
 
class CachingTest(TestCase):
    def test_get_group_key(self):
        key = get_group_key('test')
    def test_get_group_key(self, cache_get):
        cache_get.return_value = 15
        key = get_group_key('test')
        assert key == 'test15'