From 49990ddae15089c3415b63aba3d89c7a6afe4c16 Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Sat, 8 Jan 2022 15:27:59 +0100 Subject: [PATCH] Add failing test --- tests/unit/test_app.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/test_app.py b/tests/unit/test_app.py index 7619a1c24..ae6c3e04e 100644 --- a/tests/unit/test_app.py +++ b/tests/unit/test_app.py @@ -38,6 +38,17 @@ def test_app_register_builtins(app): assert "builtin:procrastinate.builtin_tasks.remove_old_jobs" in app.tasks +def test_builtin_tasks_prefix(app, connector): + # Test that when assigning multiple apps, we don't end up with duplicate + # namespaces. + app2 = app_module.App(connector=connector) + assert "builtin:procrastinate.builtin_tasks.remove_old_jobs" in app.tasks + assert ( + "builtin:builtin:procrastinate.builtin_tasks.remove_old_jobs" not in app.tasks + ) + assert app2.tasks == app.tasks + + def test_app_register(app): task = tasks.Task(task_func, blueprint=app, queue="queue", name="bla")