Skip to content

Commit

Permalink
fix: survey tests (#26892)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Dec 13, 2024
1 parent 7f06bec commit 3b159f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion posthog/api/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def validate(self, data):
if response_sampling_start_date < today_utc:
raise serializers.ValidationError(
{
"response_sampling_start_date": "Response sampling start date must be today or a future date in UTC."
"response_sampling_start_date": f"Response sampling start date must be today or a future date in UTC. Got {response_sampling_start_date} when current time is {today_utc}"
}
)

Expand Down
2 changes: 2 additions & 0 deletions posthog/api/test/test_survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -2378,6 +2378,7 @@ def test_can_clear_associated_actions(self):
assert len(survey.actions.all()) == 0


@freeze_time("2024-12-12 00:00:00")
class TestSurveyResponseSampling(APIBaseTest):
def _create_survey_with_sampling_limits(
self,
Expand Down Expand Up @@ -2407,6 +2408,7 @@ def _create_survey_with_sampling_limits(
)

response_data = response.json()
assert response.status_code == status.HTTP_201_CREATED, response_data
survey = Survey.objects.get(id=response_data["id"])
return survey

Expand Down

0 comments on commit 3b159f6

Please sign in to comment.