Skip to content

Commit

Permalink
Add timezones to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Sep 20, 2023
1 parent 4b9c236 commit c7238eb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions posthog/hogql_queries/test/test_lifecycle_hogql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,17 @@ def test_events_query_partial_range(self):
)

def test_equivalence_to_non_hogql(self):
date_from = "2020-01-01"
date_to = "2020-01-30"
self._create_prng_events(num_people=50, num_events_per_person=50, start_date=date_from, end_date=date_to)
hogql_response = self._strip_to_lcd(self._run_lifecycle_query(date_from, date_to, IntervalType.day).result)
non_hogql_response = self._strip_to_lcd(
self._run_lifecycle_query_non_hogql(date_from, date_to, IntervalType.day)
)
now = isoparse("2023-09-19T19:43:50+07:00")
event_start = "2023-08-19"
event_end = "2023-09-19"
date_to = None
date_from = None
interval = IntervalType.day
self.team.timezone = "Pacific/Tahiti"
self.team.save()
self._create_prng_events(num_people=100, num_events_per_person=100, start_date=event_start, end_date=event_end)
with freeze_time(now):
hogql_response = self._strip_to_lcd(self._run_lifecycle_query(date_from, date_to, interval).result)
non_hogql_response = self._strip_to_lcd(self._run_lifecycle_query_non_hogql(date_from, date_to, interval))

self.assertEqual(hogql_response, non_hogql_response)

0 comments on commit c7238eb

Please sign in to comment.