From 2831e5d7c10cb621e13ffd383d48e26d83586298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Wed, 14 Apr 2021 12:00:32 +0300 Subject: [PATCH] Add a test case for filtering flips by timestamp --- hc/api/tests/test_get_flips.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hc/api/tests/test_get_flips.py b/hc/api/tests/test_get_flips.py index ae680dfc..05393b0d 100644 --- a/hc/api/tests/test_get_flips.py +++ b/hc/api/tests/test_get_flips.py @@ -64,6 +64,13 @@ class GetFlipsTestCase(BaseTestCase): r = self.get(qs="?start=-123") self.assertEqual(r.status_code, 400) + def test_it_filters_by_start(self): + r = self.get(qs="?start=1591014300") # 2020-06-01 12:25:00 + self.assertEqual(r.status_code, 200) + + doc = r.json() + self.assertEqual(doc["flips"], []) + def test_it_rejects_huge_start(self): r = self.get(qs="?start=12345678901234567890") self.assertEqual(r.status_code, 400)