Exemplo n.º 1
0
        def failing_task():
            tasks.acquire_lock("dummylock", 3600)

            try:
                models.Video.objects.create(public_id="id")
                models.Video.objects.create(public_id="id")
            finally:
                tasks.release_lock("dummylock")
Exemplo n.º 2
0
 def test_acquire_release_lock_cycle(self):
     self.assertTrue(tasks.acquire_lock("dummylock"))
     self.assertRaises(exceptions.LockUnavailable, tasks.acquire_lock,
                       "dummylock")
     tasks.release_lock("dummylock")
     self.assertTrue(tasks.acquire_lock("dummylock"))
Exemplo n.º 3
0
 def setUp(self):
     tasks.release_lock("dummylock")
Exemplo n.º 4
0
 def tearDown(self):
     tasks.release_lock("dummylock")
Exemplo n.º 5
0
 def setUp(self):
     tasks.release_lock('dummylock')