From 7019325b48cd350b22729f504ff38e5ec31c54b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Sat, 2 Jan 2016 22:13:48 +0200 Subject: [PATCH] Investigating Travis/mysql test failure --- hc/api/tests/test_check_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hc/api/tests/test_check_model.py b/hc/api/tests/test_check_model.py index f8a2ead7..0c559a7d 100644 --- a/hc/api/tests/test_check_model.py +++ b/hc/api/tests/test_check_model.py @@ -9,11 +9,13 @@ class CheckModelTestCase(TestCase): check.save() 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() check.prune_pings(keep_limit=3) + self.assertEqual(check.n_pings, 3) + ua_set = set(Ping.objects.values_list("ua", flat=True)) # UA0, UA1, UA2 should have been pruned-- self.assertEqual(ua_set, set(["UA3", "UA4", "UA5"]))