Fix incorrect session usage in tests
Fix incorrect session usage in tests

One of the helper function in tests have not used SQLAlchemy session
where it should have, resulting in 'database is locked' error in SQLite.

Fixed usage of sessions in this function.

Change-Id: I4ab3f99aad82ae29bacf27ea9331f246ebdfda69
Closes-bug: 1406315

promptworks/keystone,MaheshIBM/keystone,nuxeh/keystone,blueboxgroup/keystone,dims/keystone,cernops/keystone,vivekdhayaal/keystone,jumpstarter-io/keystone,openstack/keystone,maestro-hybrid-cloud/keystone,promptworks/keystone,openstack/keystone,dims/keystone,dstanek/keystone,jonnary/keystone,klmitch/keystone,klmitch/keystone,rushiagr/keystone,UTSA-ICS/keystone-kerberos,idjaw/keystone,roopali8/keystone,MaheshIBM/keystone,rushiagr/keystone,himanshu-setia/keystone,vivekdhayaal/keystone,dstanek/keystone,ajayaa/keystone,jamielennox/keystone,takeshineshiro/keystone,jumpstarter-io/keystone,blueboxgroup/keystone,ilay09/keystone,UTSA-ICS/keystone-kerberos,idjaw/keystone,jamielennox/keystone,nuxeh/keystone,rajalokan/keystone,nuxeh/keystone,jumpstarter-io/keystone,cernops/keystone,dstanek/keystone,rajalokan/keystone,himanshu-setia/keystone,jonnary/keystone,ajayaa/keystone,mahak/keystone,ilay09/keystone,mahak/keystone,promptworks/keystone,rushiagr/keystone,roopali8/keystone,ilay09/keystone,vivekdhayaal/keystone,mahak/keystone,maestro-hybrid-cloud/keystone,takeshineshiro/keystone,openstack/keystone,rajalokan/keystone