mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
Paging in Veranstaltungsliste nicht korrekt #316
This commit is contained in:
parent
f1fff58b7b
commit
5db227090b
@ -291,8 +291,8 @@ def get_events_query(params):
|
||||
event_filter = and_(event_filter, Event.dates.any(date_filter))
|
||||
return (
|
||||
Event.query.join(Event.admin_unit)
|
||||
.join(EventPlace, isouter=True)
|
||||
.join(Location, isouter=True)
|
||||
.join(Event.event_place, isouter=True)
|
||||
.join(EventPlace.location, isouter=True)
|
||||
.options(
|
||||
contains_eager(Event.event_place).contains_eager(EventPlace.location),
|
||||
joinedload(Event.categories),
|
||||
|
||||
@ -183,3 +183,21 @@ def test_get_recurring_events(client, seeder, app):
|
||||
|
||||
assert len(recurring_events) == 1
|
||||
assert recurring_events[0].id == event_id
|
||||
|
||||
|
||||
def test_get_events_query(client, seeder, utils):
|
||||
from project.services.event import get_events_query
|
||||
from project.services.event_search import EventSearchParams
|
||||
|
||||
_, admin_unit_id = seeder.setup_base()
|
||||
seeder.create_event(admin_unit_id)
|
||||
seeder.upsert_event_place(admin_unit_id, "Other Place")
|
||||
|
||||
params = EventSearchParams()
|
||||
params.admin_unit_id = admin_unit_id
|
||||
params.can_read_private_events = True
|
||||
|
||||
events = get_events_query(params)
|
||||
pagination = events.paginate()
|
||||
|
||||
assert pagination.total == 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user