示例#1
0
 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=/')
示例#2
0
 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')
示例#3
0
 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')
示例#4
0
 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
示例#5
0
 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
示例#6
0
 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()
示例#7
0
    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")
示例#8
0
 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()
示例#9
0
 def tearDown(self):
     testutil.set_identity_user(None)
示例#10
0
 def tearDown(self):
     testutil.set_identity_user(None)
     session.rollback()
示例#11
0
 def tearDown(self):
     testutil.set_identity_user(None)
示例#12
0
 def tearDown(self):
     testutil.set_identity_user(None)
     session.rollback()