Exemplo n.º 1
0
 def send_task(self, request, response):
     ''' send off a celery task for the current page and recache '''
     # TODO is this too messy?
     from bettercache.tasks import GeneratePage
     try:
         GeneratePage.apply_async((strip_wsgi(request),))
     except:
         logger.error("failed to send celery task")
     self.set_cache(request, response)
Exemplo n.º 2
0
    def send_task(self, request, response):
        """send off a celery task for the current page and recache"""

        # TODO is this too messy?
        from bettercache.tasks import GeneratePage
        try:
            GeneratePage.apply_async((strip_wsgi(request), ))
        except:
            logger.error("failed to send celery task")
        self.set_cache(request, response)
 def setUp(self):
     self.gp = GeneratePage()
class TestGeneratePage(TestCase):
    def setUp(self):
        self.gp = GeneratePage()

    def test_should_rebuild(self):
        self.assertTrue(self.gp.should_rebuild(mock.Mock()))