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

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

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
 
    def test_expire_cache_group(self, cache_set, cache_get):
        cache_get.return_value = 15
        expire_cache_group('test')
        cache_set.assert_called_with('cache_group_test', 16, TIME_TO_CACHE)
 
        response = decorated_view(request)
 
        cache_page.assert_called_with(TIME_TO_CACHE, key_prefix='test15')
 
    @patch('cache_tools.tools.cache_page')
        response = decorated_view(request)
 
        cache_page.assert_called_with(TIME_TO_CACHE, key_prefix='test1')

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
 
    def test_expire_cache_group(self, cache_set, cache_get):
        cache_get.return_value = 15
        expire_cache_group('test')
        cache_set.assert_called_with('cache_group_test', 16, TIME_TO_CACHE)
 
        response = decorated_view(request)
 
        cache_page.assert_called_with(TIME_TO_CACHE, key_prefix='test15')
 
    @patch('cache_tools.tools.cache_page')
        response = decorated_view(request)
 
        cache_page.assert_called_with(TIME_TO_CACHE, key_prefix='test1')