Fix unit test to work with new security mode detection