Skip to content

Commit

Permalink
tests: Trick the last_updated timestamp to be different on mysql
Browse files Browse the repository at this point in the history
MySQL only has second granularity in its time field. So sorting by last_updated didn't work. Ooops. Yes, this is quite ugly.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
  • Loading branch information
Damien Lespiau committed Jan 14, 2016
1 parent e531700 commit 8868fe1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions patchwork/tests/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import hashlib
import json
import re
import time

from django.core import mail

Expand Down Expand Up @@ -101,6 +102,7 @@ def setUp(self):

# a second series so we can test ordering/filtering
test_series = TestSeries(3, project=self.project)
time.sleep(1)
test_series.insert()
self.series2 = Series.objects.all().order_by('submitted')[1]

Expand All @@ -110,6 +112,7 @@ def setUp(self):
# no cover letter
test_series = TestSeries(3, project=self.project,
sender=series3_sender, has_cover_letter=False)
time.sleep(1)
test_series.insert()
self.series3 = Series.objects.all().order_by('submitted')[2]

Expand Down

0 comments on commit 8868fe1

Please sign in to comment.