aboutsummaryrefslogtreecommitdiff
path: root/backend/tests
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-03 21:31:02 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-03 21:31:02 +1100
commit6438f8e880df5b04ff974179897ae507bb30285c (patch)
tree626382eebe5f04d5005415fe4fc4a1be4e4aca73 /backend/tests
parentc42b35d10cda3e4c3127f3a6cb4312d7b6cfe3f6 (diff)
Query server when zoomed in enough even if within an already queried range
For server query parameter range=date1.date2, exclude date2 Fix unnecessary calendar-to-year date conversion when building sql query For frontend DateRangeTree class, rename has() to contains()
Diffstat (limited to 'backend/tests')
-rw-r--r--backend/tests/test_histplorer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/tests/test_histplorer.py b/backend/tests/test_histplorer.py
index 592d534..68aae8f 100644
--- a/backend/tests/test_histplorer.py
+++ b/backend/tests/test_histplorer.py
@@ -2,7 +2,7 @@ import unittest
import tempfile, os
from tests.common import createTestDbTable
-from histplorer import handleReq, HistDate, Event, EventResponse, ImgInfo, EventInfo, SuggResponse
+from histplorer import handleReq, HistDate, Event, ImgInfo, EventInfo, SuggResponse
def initTestDb(dbFile: str) -> None:
createTestDbTable(
@@ -115,7 +115,7 @@ class TestHandleReq(unittest.TestCase):
Event(3, 'event three', HistDate(True, 1990, 10, 10), HistDate(True, 2000, 10, 10), None, None,
'discovery', 30, 0),
])
- self.assertEqual(response.unitCounts, {1900: 2, 1990: 1, 2000: 1, 2001: 1, 2002: 1})
+ self.assertEqual(response.unitCounts, {1900: 2, 1990: 1, 2000: 1, 2001: 1})
response = handleReq(self.dbFile, {'QUERY_STRING': 'type=events&range=.1999-11-27&scale=1&ctg=event'})
self.assertEqual(response.events, [
Event(4, 'event four', HistDate(False, -2000, 10, 10), None, HistDate(False, 1, 10, 10), None,