Files
authentik/authentik/tasks/tests.py
Marc 'risson' Schmitt 9a536ee4b9 wip
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2025-03-12 18:07:55 +01:00

19 lines
433 B
Python

from dramatiq import Worker, get_broker
from django.test import TransactionTestCase
class TaskTestCase(TransactionTestCase):
def _pre_setup(self):
super()._pre_setup()
self.broker = get_broker()
self.broker.flush_all()
self.worker = Worker(self.broker, worker_timeout=100)
self.worker.start()
def _post_teardown(self):
self.worker.stop()
super()._post_teardown()