#NEWLINE# def testDoUserAuthWithAllDomainUsersOffFailure( self ) : #NEWLINE# #INDENT# self . stubs . Set ( auth . settings , 'ALLOW_ALL_DOMAIN_USERS_READ_ACCESS' , False ) #NEWLINE# self . stubs . Set ( auth , 'users' , self . mox . CreateMock ( auth . users ) ) #NEWLINE# self . mox . StubOutWithMock ( auth , 'IsAdminUser' ) #NEWLINE# self . mox . StubOutWithMock ( auth , 'IsSupportUser' ) #NEWLINE# self . mox . StubOutWithMock ( auth , 'IsSecurityUser' ) #NEWLINE# self . mox . StubOutWithMock ( auth , 'IsPhysicalSecurityUser' ) #NEWLINE# mock_user = self . mox . CreateMockAnything ( ) #NEWLINE# email = 'foouser@example.com' #NEWLINE# auth . users . get_current_user ( ) . AndReturn ( mock_user ) #NEWLINE# mock_user . email ( ) . AndReturn ( email ) #NEWLINE# auth . IsAdminUser ( email ) . AndReturn ( False ) #NEWLINE# auth . IsSupportUser ( email ) . AndReturn ( False ) #NEWLINE# auth . IsSecurityUser ( email ) . AndReturn ( False ) #NEWLINE# auth . IsPhysicalSecurityUser ( email ) . AndReturn ( False ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# self . assertRaises ( auth . NotAuthenticated , auth . DoUserAuth ) #NEWLINE# self . mox . VerifyAll ( )