Skip to content

Commit 23b964a

Browse files
committed
Reproduce sentry issue
1 parent 4678f5e commit 23b964a

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

tests/onegov/agency/test_views.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,3 +953,30 @@ def test_agency_map(client: Client[AgencyApp]) -> None:
953953

954954
page = client.get('/organization/finanzkontrolle')
955955
assert 'marker-map' in page
956+
957+
958+
def test_view_agencies_browse(client: Client[AgencyApp]) -> None:
959+
client.login_admin()
960+
961+
manage = client.get('/organizations').click('Organisation', href='new')
962+
manage.form['title'] = 'Bundesbehörden'
963+
bund = manage.form.submit().follow()
964+
965+
manage = bund.click('Organisation', href='new')
966+
manage.form['title'] = 'Nationalrat'
967+
manage.form.submit()
968+
969+
session = client.app.session()
970+
nationalrat = session.query(ExtendedAgency).filter_by(
971+
title='Nationalrat'
972+
).one()
973+
974+
anonymous = client.spawn()
975+
976+
# the children are loaded lazily, so they are not part of the response
977+
assert 'Nationalrat' not in anonymous.get('/organizations')
978+
979+
page = anonymous.get(f'/organizations?browse={nationalrat.id}')
980+
assert 'Nationalrat' in page
981+
982+
anonymous.get('/organizations?browse=bogus', status=400)

0 commit comments

Comments
 (0)