File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments