Unit testing 使用@login\u必需的修饰符进行单元测试
我在我的项目中使用tipfy和gae。 我编写单元测试,我将面临一个问题: 如何测试具有@login\u所需装饰器的处理程序Unit testing 使用@login\u必需的修饰符进行单元测试,unit-testing,google-app-engine,tipfy,werkzeug,Unit Testing,Google App Engine,Tipfy,Werkzeug,我在我的项目中使用tipfy和gae。 我编写单元测试,我将面临一个问题: 如何测试具有@login\u所需装饰器的处理程序 class TestHandler(unittest.TestCase): def setUp(self): self.app = App(rules=rules, config=config, debug=True) self.client = self.app.get_test_client() def test
class TestHandler(unittest.TestCase):
def setUp(self):
self.app = App(rules=rules, config=config, debug=True)
self.client = self.app.get_test_client()
def test_my_handler(self):
r = self.client.post('/service')
# hardworking
self.assertTrue(r.status_code == 200)
如何为当前处理程序(“/service”)设置“self.auth.user”
问候、感谢和抱歉我的英语)
Oleg可能太晚了,但我发现了这个可能太晚了,但我发现了这个