def setUp(self): super(AccountsTest, self).setUp() self.flags(verbose=True) self.stubs.Set(accounts.Controller, '__init__', fake_init) fakes.FakeAuthManager.clear_fakes() fakes.FakeAuthDatabase.data = {} fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) fakemgr = fakes.FakeAuthManager() joeuser = auth_manager.User('id1', 'guy1', 'acc1', 'secret1', False) superuser = auth_manager.User('id2', 'guy2', 'acc2', 'secret2', True) fakemgr.add_user(joeuser) fakemgr.add_user(superuser) fakemgr.create_project('test1', joeuser) fakemgr.create_project('test2', superuser)
def setUp(self): super(UsersTest, self).setUp() self.flags(verbose=True) self.stubs.Set(users.Controller, '__init__', fake_init) fakes.FakeAuthManager.clear_fakes() fakes.FakeAuthManager.projects = dict(testacct=auth_manager.Project( 'testacct', 'testacct', 'id1', 'test', [])) fakes.FakeAuthDatabase.data = {} fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) fakemgr = fakes.FakeAuthManager() fakemgr.add_user( auth_manager.User('id1', 'guy1', 'acc1', 'secret1', False)) fakemgr.add_user( auth_manager.User('id2', 'guy2', 'acc2', 'secret2', True)) self.controller = users.Controller()