Enabled 3.5 on travis

This commit is contained in:
ilvalle
2016-06-02 16:06:49 +02:00
parent a1fd92b7f8
commit 707330accd
9 changed files with 42 additions and 34 deletions
+16 -15
View File
@@ -1,28 +1,29 @@
import sys
from .test_http import *
from .test_cache import *
from .test_contenttype import *
from .test_compileapp import *
from .test_fileutils import *
from .test_globals import *
from .test_html import *
from .test_is_url import *
from .test_languages import *
from .test_router import *
from .test_recfile import *
from .test_routes import *
from .test_storage import *
from .test_serializers import *
from .test_template import *
from .test_validators import *
from .test_utils import *
from .test_dal import *
from .test_tools import *
from .test_appadmin import *
from .test_scheduler import *
if sys.version[:3] == '2.7':
from .test_cache import *
from .test_compileapp import *
from .test_html import *
from .test_is_url import *
from .test_languages import *
from .test_router import *
from .test_routes import *
from .test_serializers import *
from .test_template import *
from .test_validators import *
from .test_utils import *
from .test_dal import *
from .test_tools import *
from .test_appadmin import *
from .test_scheduler import *
from .test_web import *
from .test_contribs import *
from .test_old_doctests import *
+7 -5
View File
@@ -14,6 +14,7 @@ fix_sys_path(__file__)
from gluon.globals import Request, Response, Session
from gluon import URL
from gluon._compat import basestring
def setup_clean_session():
request = Request(env={})
@@ -158,31 +159,32 @@ class testResponse(unittest.TestCase):
current = setup_clean_session()
current.session._fixup_before_save()
cookie = str(current.response.cookies)
self.assertTrue('secure' not in cookie)
self.assertTrue('secure' not in cookie.lower())
current = setup_clean_session()
current.session.secure()
current.session._fixup_before_save()
cookie = str(current.response.cookies)
self.assertTrue('secure' in cookie)
self.assertTrue('secure' in cookie.lower())
def test_cookies_httponly(self):
current = setup_clean_session()
current.session._fixup_before_save()
cookie = str(current.response.cookies)
self.assertTrue('httponly' in cookie)
# cookies in PY3 have capital letters
self.assertTrue('httponly' in cookie.lower())
current = setup_clean_session()
current.session.httponly_cookies = True
current.session._fixup_before_save()
cookie = str(current.response.cookies)
self.assertTrue('httponly' in cookie)
self.assertTrue('httponly' in cookie.lower())
current = setup_clean_session()
current.session.httponly_cookies = False
current.session._fixup_before_save()
cookie = str(current.response.cookies)
self.assertTrue('httponly' not in cookie)
self.assertTrue('httponly' not in cookie.lower())
if __name__ == '__main__':
unittest.main()