From f4abbe60fd67a718ef68d2a01fa143e929144821 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Fri, 24 May 2013 00:17:30 +0100 Subject: [PATCH] fix certificate download test --- autovpn/test/test_vpn_app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autovpn/test/test_vpn_app.py b/autovpn/test/test_vpn_app.py index 4549fd2..0fefdec 100644 --- a/autovpn/test/test_vpn_app.py +++ b/autovpn/test/test_vpn_app.py @@ -26,6 +26,7 @@ class VpnAppTest(unittest.TestCase): ''', 'AUTH_ENABLE': True, 'AUTH_FUNCTION': lambda x, y: (x and y and x == y), + 'TLS_AUTH_KEY': self.tmpdir + '/tlsauth.key', } self.app = vpn_app.make_app(self.config) @@ -57,11 +58,13 @@ class VpnAppTest(unittest.TestCase): self.assertTrue('Authentication failed' in rv.data) def test_cert_dl(self): + cn = 'testcn1234' + t = self.app.signer.encode(cn) with self.app.test_client() as c: with c.session_transaction() as sess: sess['dl_ok'] = True sess['_csrf'] = 'csrf' sess['logged_in'] = True - rv = c.get('/newcertdl?_csrf=csrf') + rv = c.get('/newcertdl?_csrf=csrf&t=' + t) self.assertEquals('200 OK', rv.status) self.assertEquals('application/zip', rv.content_type) -- GitLab