Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tkaemming committed Sep 17, 2024
1 parent 266b259 commit 929512b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions posthog/hogql_queries/test/test_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
HogQLQueryModifiers,
MaterializationMode,
PersonsOnEventsMode,
PropertyGroupsMode,
TestBasicQueryResponse,
TestCachedBasicQueryResponse,
)
Expand Down Expand Up @@ -97,6 +98,7 @@ def test_cache_payload(self):
"personsOnEventsMode": PersonsOnEventsMode.PERSON_ID_OVERRIDE_PROPERTIES_JOINED,
"bounceRatePageViewMode": "count_pageviews",
"sessionTableVersion": "auto",
"propertyGroupsMode": PropertyGroupsMode.OPTIMIZED,
},
"limit_context": "query",
"query": {"kind": "TestQuery", "some_attr": "bla"},
Expand All @@ -115,7 +117,7 @@ def test_cache_key(self):
runner = TestQueryRunner(query={"some_attr": "bla"}, team=team)

cache_key = runner.get_cache_key()
self.assertEqual(cache_key, "cache_93427f8f06e6cc8643a394ae002de2c1")
self.assertEqual(cache_key, "cache_f817acc64fbd0e71a7bf2e3db522fe85")

def test_cache_key_runner_subclass(self):
TestQueryRunner = self.setup_test_query_runner_class()
Expand All @@ -129,7 +131,7 @@ class TestSubclassQueryRunner(TestQueryRunner):
runner = TestSubclassQueryRunner(query={"some_attr": "bla"}, team=team)

cache_key = runner.get_cache_key()
self.assertEqual(cache_key, "cache_bb6398a99867dfbdc45a2fc4fccb8f27")
self.assertEqual(cache_key, "cache_16ce7e72c5350f61dfa9ae461f3db9d6")

def test_cache_key_different_timezone(self):
TestQueryRunner = self.setup_test_query_runner_class()
Expand All @@ -140,7 +142,7 @@ def test_cache_key_different_timezone(self):
runner = TestQueryRunner(query={"some_attr": "bla"}, team=team)

cache_key = runner.get_cache_key()
self.assertEqual(cache_key, "cache_e0c2bb1ad091102533399ebdddbfb24d")
self.assertEqual(cache_key, "cache_e41dc8347514c8f102764db150ddf800")

@mock.patch("django.db.transaction.on_commit")
def test_cache_response(self, mock_on_commit):
Expand Down

0 comments on commit 929512b

Please sign in to comment.