def setUp(self): testutil.DBTest.setUp(self) turbogears.startup.startTurboGears() self.test_user = self.create_current_user() testutil.set_identity_user(self.test_user) self.session = testutil.BrowsingSession() self.session.goto('/login?login_user=12345&login_password=password&login_submit=Login&forward_url=/')
def setUp(self): from bkr.server.jobs import Jobs self.controller = Jobs() self.user = data_setup.create_user() group = data_setup.create_group(group_name='somegroup') self.user.groups.append(group) testutil.set_identity_user(self.user) data_setup.create_distro_tree(distro_name=u'BlueShoeLinux5-5') data_setup.create_product(product_name=u'the_product')
def test_logout_with_set_identity(self): """Test that logout works even when there is no visit_key (e.g. when testutils.set_identity_user is used).""" request = testutil.DummyRequest() old_user = testutil.test_user user = TG_User.by_user_name("samIam") testutil.set_identity_user(user) testutil.attach_identity(request) testutil.set_identity_user(old_user) testutil.call_with_request(cherrypy.root.logout, request) assert request.identity.anonymous
def setUp(self): session.begin() from bkr.server.jobs import Jobs self.controller = Jobs() self.user = data_setup.create_user(user_name=u'test-job-owner', email_address=u'*****@*****.**') group = data_setup.create_group(group_name='somegroup') group.add_member(self.user) testutil.set_identity_user(self.user) data_setup.create_product(product_name=u'the_product') session.flush()
def setUp(self): from bkr.server.jobs import Jobs self.controller = Jobs() self.user = data_setup.create_user() group = data_setup.create_group(group_name="somegroup") self.user.groups.append(group) testutil.set_identity_user(self.user) if not Distro.by_name(u"BlueShoeLinux5-5"): data_setup.create_distro_tree(distro_name=u"BlueShoeLinux5-5") data_setup.create_product(product_name=u"the_product")
def setUp(self): session.begin() from bkr.server.jobs import Jobs self.controller = Jobs() self.user = data_setup.create_user( user_name=u'test-job-owner', email_address=u'*****@*****.**') group = data_setup.create_group(group_name='somegroup') group.add_member(self.user) testutil.set_identity_user(self.user) data_setup.create_product(product_name=u'the_product') session.flush()
def tearDown(self): testutil.set_identity_user(None)
def tearDown(self): testutil.set_identity_user(None) session.rollback()