new tests in test_web, tests static/_1.2.3/...
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.1.0 (2012-10-13 10:16:02) dev
|
||||
Version 2.1.0 (2012-10-13 14:36:14) dev
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user