Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(revenue-analytics): remove narration from charge builder tests (#129555)

posthog[bot]73b1e6247a05
diff --git a/products/revenue_analytics/backend/views/sources/test/stripe/test_stripe_charge.py b/products/revenue_analytics/backend/views/sources/test/stripe/test_stripe_charge.py
index 09d3b511d876..343fe7e6f632 100644
--- a/products/revenue_analytics/backend/views/sources/test/stripe/test_stripe_charge.py
+++ b/products/revenue_analytics/backend/views/sources/test/stripe/test_stripe_charge.py
@@ -11,28 +11,23 @@ class TestChargeStripeBuilder(StripeSourceBaseTest):
def test_build_charge_query_with_charge_schema(self):
"""Test building charge query when charge schema exists."""
- # Setup with only charge schema
self.setup_stripe_external_data_source(schemas=[CHARGE_RESOURCE_NAME])
query = build(self.stripe_handle)
charge_table = self.get_stripe_table_by_schema_name(CHARGE_RESOURCE_NAME)
- # Test the query structure
self.assertQueryContainsFields(query.query, CHARGE_SCHEMA)
self.assertBuiltQueryStructure(query, str(charge_table.id), f"stripe.{self.external_data_source.prefix}")
- # Print and snapshot the generated HogQL query
query_sql = query.query.to_hogql()
self.assertQueryMatchesSnapshot(query_sql, replace_all_numbers=True)
def test_build_with_no_charge_schema(self):
"""Test that build returns view even when no charge schema exists."""
- # Setup without charge schema
self.setup_stripe_external_data_source(schemas=[])
query = build(self.stripe_handle)
- # Test the query structure
self.assertQueryContainsFields(query.query, CHARGE_SCHEMA)
self.assertBuiltQueryStructure(
query,
@@ -41,20 +36,17 @@ class TestChargeStripeBuilder(StripeSourceBaseTest):
expected_test_comments="no_schema",
)
- # Print and snapshot the generated HogQL query
query_sql = query.query.to_hogql()
self.assertQueryMatchesSnapshot(query_sql, replace_all_numbers=True)
def test_build_with_charge_schema_but_no_table(self):
"""Test that build returns view even when charge schema exists but has no table."""
- # Setup with charge schema but no table
self.setup_stripe_external_data_source_with_specific_schemas(
[{"name": CHARGE_RESOURCE_NAME, "table_name": None}]
)
query = build(self.stripe_handle)
- # Test the query structure
self.assertQueryContainsFields(query.query, CHARGE_SCHEMA)
self.assertBuiltQueryStructure(
query,
@@ -63,7 +55,6 @@ class TestChargeStripeBuilder(StripeSourceBaseTest):
expected_test_comments="no_table",
)
- # Print and snapshot the generated HogQL query
query_sql = query.query.to_hogql()
self.assertQueryMatchesSnapshot(query_sql, replace_all_numbers=True)
@@ -76,7 +67,6 @@ class TestChargeStripeBuilder(StripeSourceBaseTest):
def test_charge_query_currency_conversion(self):
"""Test that charge query includes currency conversion logic."""
- # Set team base currency to test conversion
self.set_team_base_currency("EUR")
self.setup_stripe_external_data_source(schemas=[CHARGE_RESOURCE_NAME])
@@ -84,10 +74,7 @@ class TestChargeStripeBuilder(StripeSourceBaseTest):
query = build(self.stripe_handle)
query_sql = query.query.to_hogql()
- # Check for currency conversion functions in the query
- # The specific implementation may vary, but should include conversion logic
self.assertIn("currency", query_sql)
self.assertIn("EUR", query_sql)
- # Print and snapshot for currency conversion case
self.assertQueryMatchesSnapshot(query_sql, replace_all_numbers=True)