aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lcm/pub/utils/tests.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/lcm/pub/utils/tests.py b/lcm/pub/utils/tests.py
index 232acf05..09b135e5 100644
--- a/lcm/pub/utils/tests.py
+++ b/lcm/pub/utils/tests.py
@@ -18,7 +18,7 @@ import enumutil
import fileutil
import urllib2
-from lcm.pub.database.models import JobStatusModel
+from lcm.pub.database.models import JobStatusModel, JobModel
from lcm.pub.utils.jobutil import JobUtil
@@ -85,3 +85,17 @@ class UtilsTest(unittest.TestCase):
self.assertEqual(2, len(jobs))
self.assertEqual(3, jobs[0].indexid)
self.assertEqual(2, jobs[1].indexid)
+ JobStatusModel.objects.filter().delete()
+
+ def test_is_job_exists(self):
+ job_id = "1"
+ JobModel.objects.filter().delete()
+ JobModel(
+ jobid=job_id,
+ jobtype="1",
+ jobaction="2",
+ resid="3",
+ status=0
+ ).save()
+ self.assertTrue(JobUtil.is_job_exists(job_id))
+ JobModel.objects.filter().delete()