0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
posthog/ee/clickhouse/materialized_columns/test/test_query.py
Michael Matloka 5d2ad6c7bb
chore(deps): Update black to 22.8.0 (#11596)
* chore(deps): Update `black` to `22.8.0`

* Format
2022-09-05 14:38:54 +02:00

26 lines
945 B
Python

from posthog.test.base import APIBaseTest, ClickhouseTestMixin
class TestQuery(ClickhouseTestMixin, APIBaseTest):
def test_get_queries_detects(self):
# some random
with self.capture_select_queries() as queries:
self.client.post(
f"/api/projects/{self.team.id}/insights/funnel/",
{
"events": [{"id": "step one", "type": "events", "order": 0}],
"funnel_window_days": 14,
"funnel_order_type": "unordered",
"insight": "funnels",
},
).json()
self.assertTrue(len(queries))
# make sure that the queries start with a discoverable prefix.
# If this changes, also update ee/clickhouse/materialized_columns/analyze.py::_get_queries to
# filter on the right queries
for q in queries:
self.assertTrue(q.startswith("/* user_id"))