diff --git a/django_q/core_signing.py b/django_q/core_signing.py index e2ceb9d..923ea28 100644 --- a/django_q/core_signing.py +++ b/django_q/core_signing.py @@ -24,11 +24,11 @@ The difference is that `this` loads function calls `TimestampSigner` and `Signer def loads( - s, - key=None, - salt: str = "django.core.signing", - serializer=JSONSerializer, - max_age=None, + s, + key=None, + salt: str = "django.core.signing", + serializer=JSONSerializer, + max_age=None, ): """ Reverse of dumps(), raise BadSignature if signature fails. diff --git a/django_q/management/commands/qmonitor.py b/django_q/management/commands/qmonitor.py index bfb9f69..ca925a0 100644 --- a/django_q/management/commands/qmonitor.py +++ b/django_q/management/commands/qmonitor.py @@ -10,12 +10,12 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( - '--run-once', - action='store_true', - dest='run_once', + "--run-once", + action="store_true", + dest="run_once", default=False, - help='Run once and then stop.', + help="Run once and then stop.", ) def handle(self, *args, **options): - monitor(run_once=options.get('run_once', False)) + monitor(run_once=options.get("run_once", False)) diff --git a/django_q/tests/test_cluster.py b/django_q/tests/test_cluster.py index 9093036..bd77758 100644 --- a/django_q/tests/test_cluster.py +++ b/django_q/tests/test_cluster.py @@ -142,6 +142,8 @@ def test_enqueue(broker, admin_user): # q_options and save opt_out test k = async_task('django_q.tests.tasks.get_user_id', admin_user, q_options={'broker': broker, 'group': 'test_k', 'save': False, 'timeout': 90}) + # test unicode + assert Task(name='Amalia').__unicode__()=='Amalia' # check if everything has a task id assert isinstance(a, str) assert isinstance(b, str) diff --git a/django_q/tests/test_scheduler.py b/django_q/tests/test_scheduler.py index bb8187c..7cd700e 100644 --- a/django_q/tests/test_scheduler.py +++ b/django_q/tests/test_scheduler.py @@ -99,6 +99,7 @@ def test_scheduler(broker, monkeypatch): cron="0 22 * * 1-5") assert hasattr(cron_schedule, 'pk') is True assert cron_schedule.full_clean() is None + assert cron_schedule.__unicode__() == 'django_q.tests.tasks.word_multiply' # All other types for t in Schedule.TYPE: if t[0] == Schedule.CRON: