|
|
@@ -1,10 +1,12 @@
|
|
|
import uuid
|
|
|
from datetime import timedelta
|
|
|
|
|
|
-from django.test import TestCase
|
|
|
+from django.test import SimpleTestCase, TestCase
|
|
|
from django.utils import timezone
|
|
|
+from rq.job import JobStatus
|
|
|
|
|
|
from core.choices import JobStatusChoices
|
|
|
+from core.constants import RQ_TASK_STATUSES
|
|
|
from core.models import Job, ObjectChange
|
|
|
from core.tables import *
|
|
|
from utilities.testing import TableTestCases
|
|
|
@@ -90,3 +92,13 @@ class ObjectChangeTableTestCase(TableTestCases.StandardTableTestCase):
|
|
|
|
|
|
class ConfigRevisionTableTestCase(TableTestCases.StandardTableTestCase):
|
|
|
table = ConfigRevisionTable
|
|
|
+
|
|
|
+
|
|
|
+class BackgroundTaskStatusBadgeTestCase(SimpleTestCase):
|
|
|
+ """
|
|
|
+ Every RQ job status needs a badge, or BackgroundTaskTable fails to render a task in that status.
|
|
|
+ """
|
|
|
+ def test_every_rq_status_has_a_badge(self):
|
|
|
+ for status in JobStatus:
|
|
|
+ with self.subTest(status=status):
|
|
|
+ self.assertIn(status, RQ_TASK_STATUSES)
|