Skip to content

Commit d269e80

Browse files
committed
Updated to correct tests relating to resolution to issue #53
System check identified no issues (0 silenced). ............................. ---------------------------------------------------------------------- Ran 29 tests in 7.158s OK
1 parent d85abd5 commit d269e80

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

django_dbq/tests.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def test_rate_with_shorter_shift_limit(self):
376376
stdout = StringIO()
377377
call_command("worker", rate_limit=2, shift_limit=1, stdout=stdout)
378378
output = stdout.getvalue()
379-
self.assertTrue("rate limit 2/s and a shift constraint of 1 seconds" in output)
379+
self.assertTrue("rate limit of one job per 2 second(s) and a shift constraint of 1 seconds" in output)
380380
self.assertEqual(Job.objects.filter(state=Job.STATES.NEW).count(), 1)
381381
self.assertEqual(Job.objects.filter(state=Job.STATES.COMPLETE).count(), 1)
382382

@@ -386,7 +386,7 @@ def test_rate_with_equal_shift_limit(self):
386386
stdout = StringIO()
387387
call_command("worker", rate_limit=1, shift_limit=1, stdout=stdout)
388388
output = stdout.getvalue()
389-
self.assertTrue("rate limit 1/s and a shift constraint of 1 seconds" in output)
389+
self.assertTrue("rate limit of one job per 1 second(s) and a shift constraint of 1 seconds" in output)
390390
self.assertEqual(Job.objects.filter(state=Job.STATES.NEW).count(), 1)
391391
self.assertEqual(Job.objects.filter(state=Job.STATES.COMPLETE).count(), 1)
392392

@@ -396,7 +396,7 @@ def test_rate_with_longer_shift_limit(self):
396396
stdout = StringIO()
397397
call_command("worker", rate_limit=1, shift_limit=2, stdout=stdout)
398398
output = stdout.getvalue()
399-
self.assertTrue("rate limit 1/s and a shift constraint of 2 seconds" in output)
399+
self.assertTrue("rate limit of one job per 1 second(s) and a shift constraint of 2 seconds" in output)
400400
self.assertEqual(Job.objects.filter(state=Job.STATES.NEW).count(), 0)
401401
self.assertEqual(Job.objects.filter(state=Job.STATES.COMPLETE).count(), 2)
402402

@@ -408,10 +408,10 @@ def test_rate_with_two_workers(self):
408408
stdout = StringIO()
409409
call_command("worker", rate_limit=1, shift_limit=2, stdout=stdout)
410410
output = stdout.getvalue()
411-
self.assertTrue("rate limit 1/s and a shift constraint of 2 seconds" in output)
411+
self.assertTrue("rate limit of one job per 1 second(s) and a shift constraint of 2 seconds" in output)
412412
call_command("worker", rate_limit=1, shift_limit=1, stdout=stdout)
413413
output = stdout.getvalue()
414-
self.assertTrue("rate limit 1/s and a shift constraint of 1 seconds" in output)
414+
self.assertTrue("rate limit of one job per 1 second(s) and a shift constraint of 1 seconds" in output)
415415
self.assertEqual(Job.objects.filter(state=Job.STATES.NEW).count(), 1)
416416
self.assertEqual(Job.objects.filter(state=Job.STATES.COMPLETE).count(), 3)
417417

test-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ freezegun==0.3.12
33
mock==3.0.5
44
dj-database-url==0.5.0
55
psycopg2==2.8.4
6-
black==21.12b0
6+
black==22.6.0

0 commit comments

Comments
 (0)