Added a test empty session creation failure and moved session create to gorm.