From 642b1eb57268887bee02d19f51f590afbf0b0f43 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Wed, 17 Jun 2015 08:14:03 +0200 Subject: [PATCH] Fix testcases. --- test/test.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/test.py b/test/test.py index 3aee8f0..e46290d 100644 --- a/test/test.py +++ b/test/test.py @@ -1,3 +1,4 @@ +import logging import sys import unittest from StringIO import StringIO @@ -243,14 +244,14 @@ class WebAppTest(unittest.TestCase): r = requests.post('http://localhost:8002/submit', data) self.assertEqual(r.status_code, 401) - def testAuthFormWrongAuthGet(self): + def testAuthFormUnauthorizedGet(self): r = requests.get('http://localhost:8002/form?form_name=admin_only', auth=self.auth_user) - self.assertEqual(r.status_code, 401) + self.assertEqual(r.status_code, 403) - def testAuthFormWrongAuthPost(self): + def testAuthFormUnauthorizedPost(self): data = {"form_name": 'admin_only'} r = requests.post('http://localhost:8002/submit', data, auth=self.auth_user) - self.assertEqual(r.status_code, 401) + self.assertEqual(r.status_code, 403) def testHidden(self): """Hidden forms shouldn't appear in the output""" @@ -312,6 +313,10 @@ class WebAppTest(unittest.TestCase): if __name__ == '__main__': + logging.basicConfig(level=logging.FATAL, + format='%(asctime)s:%(name)s:%(levelname)s:%(message)s', + filename='test.log', + filemode='a') import coverage cov = coverage.coverage(omit=['*test*', 'main']) cov.start()