|
2 | 2 | datetime, |
3 | 3 | timedelta, |
4 | 4 | ) |
| 5 | +from packaging.version import Version |
5 | 6 | from typing import ( |
6 | 7 | Any, |
7 | 8 | Dict, |
@@ -34,7 +35,11 @@ def test_notification_status(self): |
34 | 35 | if not self.gi.users.get_current_user()["is_admin"]: |
35 | 36 | self.skipTest("This tests requires the current user to be an admin, which is not the case.") |
36 | 37 |
|
37 | | - task_based = self.gi.config.get_config()["enable_celery_tasks"] |
| 38 | + # sending notifications are handled by tasks since 24.1 if celery is enabled |
| 39 | + version = self.gi.config.get_config()["version_major"] |
| 40 | + task_based = self.gi.config.get_config()["enable_celery_tasks"] and ( |
| 41 | + version == "dev" or Version(version) >= Version("24.1") |
| 42 | + ) |
38 | 43 |
|
39 | 44 | # user creation for the test |
40 | 45 | user1 = self._create_local_test_user(password="password") |
@@ -150,7 +155,11 @@ def test_get_user_notifications(self): |
150 | 155 | if not self.gi.users.get_current_user()["is_admin"]: |
151 | 156 | self.skipTest("This tests requires the current user to be an admin, which is not the case.") |
152 | 157 |
|
153 | | - task_based = self.gi.config.get_config()["enable_celery_tasks"] |
| 158 | + # sending notifications are handled by tasks since 24.1 if celery is enabled |
| 159 | + version = self.gi.config.get_config()["version_major"] |
| 160 | + task_based = self.gi.config.get_config()["enable_celery_tasks"] and ( |
| 161 | + version == "dev" or Version(version) >= Version("24.1") |
| 162 | + ) |
154 | 163 |
|
155 | 164 | # send the notifications |
156 | 165 | user_id = [self.gi.users.get_current_user()["id"]] |
@@ -248,7 +257,12 @@ def test_show_notification(self): |
248 | 257 | self.skipTest("This Galaxy instance is not configured to use notifications.") |
249 | 258 | if not self.gi.users.get_current_user()["is_admin"]: |
250 | 259 | self.skipTest("This tests requires the current user to be an admin, which is not the case.") |
251 | | - task_based = self.gi.config.get_config()["enable_celery_tasks"] |
| 260 | + |
| 261 | + # sending notifications are handled by tasks since 24.1 if celery is enabled |
| 262 | + version = self.gi.config.get_config()["version_major"] |
| 263 | + task_based = self.gi.config.get_config()["enable_celery_tasks"] and ( |
| 264 | + version == "dev" or Version(version) >= Version("24.1") |
| 265 | + ) |
252 | 266 |
|
253 | 267 | # user creation for the test |
254 | 268 | user = self._create_local_test_user(password="password") |
@@ -280,7 +294,11 @@ def test_update_notifications(self): |
280 | 294 | self.skipTest("This Galaxy instance is not configured to use notifications.") |
281 | 295 | if not self.gi.users.get_current_user()["is_admin"]: |
282 | 296 | self.skipTest("This tests requires the current user to be an admin, which is not the case.") |
283 | | - task_based = self.gi.config.get_config()["enable_celery_tasks"] |
| 297 | + # sending notifications are handled by tasks since 24.1 if celery is enabled |
| 298 | + version = self.gi.config.get_config()["version_major"] |
| 299 | + task_based = self.gi.config.get_config()["enable_celery_tasks"] and ( |
| 300 | + version == "dev" or Version(version) >= Version("24.1") |
| 301 | + ) |
284 | 302 |
|
285 | 303 | # user creation for the test |
286 | 304 | user = self._create_local_test_user(password="password") |
@@ -363,7 +381,11 @@ def test_delete_notifications(self): |
363 | 381 | self.skipTest("This Galaxy instance is not configured to use notifications.") |
364 | 382 | if not self.gi.users.get_current_user()["is_admin"]: |
365 | 383 | self.skipTest("This tests requires the current user to be an admin, which is not the case.") |
366 | | - task_based = self.gi.config.get_config()["enable_celery_tasks"] |
| 384 | + # sending notifications are handled by tasks since 24.1 if celery is enabled |
| 385 | + version = self.gi.config.get_config()["version_major"] |
| 386 | + task_based = self.gi.config.get_config()["enable_celery_tasks"] and ( |
| 387 | + version == "dev" or Version(version) >= Version("24.1") |
| 388 | + ) |
367 | 389 |
|
368 | 390 | # user creation for the test |
369 | 391 | user = self._create_local_test_user(password="password") |
|
0 commit comments