new tests in test_web, tests static/_1.2.3/...

This commit is contained in:
mdipierro
2012-10-13 14:36:20 -05:00
parent 0b0fddb886
commit 40c09a5d80
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.1.0 (2012-10-13 10:16:02) dev
Version 2.1.0 (2012-10-13 14:36:14) dev
+12
View File
@@ -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()