<s> import transaction <EOL> from websauna . system . user . models import User <EOL> from websauna . system . user . models import Group <EOL> from websauna . system . user . utils import get_site_creator <EOL> def test_virgin_init_admin ( init , dbsession ) : <EOL> """<STR_LIT>""" <EOL> with transaction . manager : <EOL> u = User ( username = "<STR_LIT>" , email = "<STR_LIT>" ) <EOL> dbsession . add ( u ) <EOL> dbsession . flush ( ) <EOL> assert not u . is_admin ( ) <EOL> site_creator = get_site_creator ( init . config . registry ) <EOL> site_creator . init_empty_site ( dbsession , u ) <EOL> with transaction . manager : <EOL> u = dbsession . query ( User ) . get ( <NUM_LIT:1> ) <EOL> assert dbsession . query ( Group ) . count ( ) == <NUM_LIT:1> <EOL> assert u . is_admin ( ) </s>
