Example #1
0
    def test_can_fake_logged_in_user(self):
        admin = DBSession.query(User).filter(User.user_name == u'admin').one()
        assert_true(admin.has_permission(u'admin'))
        self.init_fake_request()
        self.set_authenticated_user(admin)

        assert_true(has_permission(u'admin'))
 def test_can_fake_logged_in_user(self):
     admin = DBSession.query(User).filter(User.user_name==u'admin').one()
     assert_true(admin.has_permission(u'admin'))
     self.init_fake_request()
     self.set_authenticated_user(admin)
     
     assert_true(has_permission(u'admin'))
Example #3
0
 def can_comment(self):
     return has_permission('comment')
 def can_comment(self):
     return has_permission('comment')