def test_already_finished(self): registry.register(SimpleHandler, ['something']) request = toolbox.add_request('abc', file_type='something') request.finished_at = timezone.now() request.save() self.assertFalse(registry.dispatch(request.id)) self.assertEqual(0, len(SimpleHandler.handled))
def test(self): registry.register(SimpleHandler, ['something']) request = toolbox.add_request('abc', file_type='something') self.assertTrue(registry.dispatch(request.id)) self.assertEqual([request], SimpleHandler.handled)