summaryrefslogtreecommitdiff
path: root/tests/tasks/test_tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tasks/test_tasks.py')
-rw-r--r--tests/tasks/test_tasks.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/tasks/test_tasks.py b/tests/tasks/test_tasks.py
index 14d47c4cf6..b66c2df058 100644
--- a/tests/tasks/test_tasks.py
+++ b/tests/tasks/test_tasks.py
@@ -312,3 +312,8 @@ class TaskTestCase(SimpleTestCase):
"Task takes context but does not have a first argument of 'context'.",
):
task(takes_context=True)(test_tasks.calculate_meaning_of_life.func)
+
+ def test_run_after_in_decorator(self):
+ msg = "run_after cannot be defined statically with the @task decorator."
+ with self.assertRaisesMessage(TypeError, msg):
+ task(run_after=timezone.now())(test_tasks.calculate_meaning_of_life.func)