Browse Source

Investigating Travis/mysql test failure

pull/25/merge
Pēteris Caune 9 years ago
parent
commit
7019325b48
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      hc/api/tests/test_check_model.py

+ 3
- 1
hc/api/tests/test_check_model.py View File

@ -9,11 +9,13 @@ class CheckModelTestCase(TestCase):
check.save() check.save()
for i in range(0, 6): for i in range(0, 6):
p = Ping(owner=check, ua="UA%d" % i)
p = Ping(pk=100 + i, owner=check, ua="UA%d" % i)
p.save() p.save()
check.prune_pings(keep_limit=3) check.prune_pings(keep_limit=3)
self.assertEqual(check.n_pings, 3)
ua_set = set(Ping.objects.values_list("ua", flat=True)) ua_set = set(Ping.objects.values_list("ua", flat=True))
# UA0, UA1, UA2 should have been pruned-- # UA0, UA1, UA2 should have been pruned--
self.assertEqual(ua_set, set(["UA3", "UA4", "UA5"])) self.assertEqual(ua_set, set(["UA3", "UA4", "UA5"]))

Loading…
Cancel
Save