test: make activity index deterministic
This commit is contained in:
@@ -18,8 +18,9 @@ def activity_rows(
|
||||
waterbody: str | None = None,
|
||||
fish: str | None = None,
|
||||
method: str | None = None,
|
||||
now: datetime | None = None,
|
||||
) -> list[ActivityOut]:
|
||||
now = datetime.now(timezone.utc)
|
||||
now = _aware(now or datetime.now(timezone.utc))
|
||||
query = (
|
||||
select(CatchReport)
|
||||
.options(
|
||||
@@ -28,6 +29,7 @@ def activity_rows(
|
||||
)
|
||||
.where(
|
||||
CatchReport.moderation_status == ModerationStatus.approved,
|
||||
CatchReport.deleted_at.is_(None),
|
||||
CatchReport.spot_id.is_not(None),
|
||||
CatchReport.reported_at >= now - timedelta(hours=hours),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user