def test_forget(self):
     b = DatabaseBackend(app=app)
     tid = gen_unique_id()
     b.mark_as_done(tid, {'foo': 'bar'})
     x = AsyncResult(tid)
     self.assertEqual(x.result.get('foo'), 'bar')
     x.forget()
     if celery.VERSION[0:3] == (3, 1, 10):
         # bug in 3.1.10 means result did not clear cache after forget.
         x._cache = None
     self.assertIsNone(x.result)
Beispiel #2
0
 def test_forget(self):
     b = DatabaseBackend(app=app)
     tid = gen_unique_id()
     b.mark_as_done(tid, {'foo': 'bar'})
     x = AsyncResult(tid)
     self.assertEqual(x.result.get('foo'), 'bar')
     x.forget()
     if celery.VERSION[0:3] == (3, 1, 10):
         # bug in 3.1.10 means result did not clear cache after forget.
         x._cache = None
     self.assertIsNone(x.result)