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'))
def can_comment(self): return has_permission('comment')