From 40c09a5d8009291ec8d907e8520aa6fd5fd35f84 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sat, 13 Oct 2012 14:36:20 -0500 Subject: [PATCH] new tests in test_web, tests static/_1.2.3/... --- VERSION | 2 +- gluon/tests/test_web.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7b567b6e..35d8d2f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.1.0 (2012-10-13 10:16:02) dev +Version 2.1.0 (2012-10-13 14:36:14) dev diff --git a/gluon/tests/test_web.py b/gluon/tests/test_web.py index 06cf9a4c..53e965dd 100644 --- a/gluon/tests/test_web.py +++ b/gluon/tests/test_web.py @@ -46,6 +46,18 @@ class TestWeb(unittest.TestCase): client.get('site') client.get('design/welcome') +class TestStaticCacheControl(unittest.TestCase): + def testWebClient(self): + s=WebClient('http://127.0.0.1:8000/welcome/') + s.get('static/js/web2py.js') + assert('expires' not in s.headers) + assert(not s.headers['cache-control'].startswith('max-age')) + text = s.text + s.get('static/_1.2.3/js/web2py.js') + assert(text == s.text) + assert('expires' in s.headers) + assert(s.headers['cache-control'].startswith('max-age')) + if __name__ == '__main__': unittest.main()