I use tipfy & gae for my project. I write unittests, and I to be confronted with a question: How I can test the handler which has @login_required decorator?
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)
How a can set 'self.auth.user' for current handler('/service')
Regards & thanks & sorry for my english )
Oleg