Ticket #15144: tests_demonstrating_regression.diff
File tests_demonstrating_regression.diff, 1.7 KB (added by , 14 years ago) |
---|
-
tests/regressiontests/cache/tests.py
1201 1201 1202 1202 other_view = cache_page(cache='other')(view) 1203 1203 other_with_prefix_view = cache_page(cache='other', key_prefix='prefix2')(view) 1204 1204 other_with_timeout_view = cache_page(4, cache='other', key_prefix='prefix3')(view) 1205 1205 1206 factory = RequestFactory() 1206 1207 request = factory.get('/view/') 1207 1208 … … 1240 1241 # And prefixing the alternate cache yields yet another cache entry 1241 1242 response = other_with_prefix_view(request, '9') 1242 1243 self.assertEquals(response.content, 'Hello World 9') 1243 1244 1245 # Request from the alternate cache with a new prefix and a custom timeout 1246 response = other_with_timeout_view(request, '20') 1247 self.assertEquals(response.content, 'Hello World 20') 1248 1244 1249 # But if we wait a couple of seconds... 1245 1250 time.sleep(2) 1246 1251 … … 1268 1273 # .. even if it has a prefix 1269 1274 response = other_with_prefix_view(request, '15') 1270 1275 self.assertEquals(response.content, 'Hello World 15') 1276 1277 # ... but a view with a custom timeout will still hit 1278 response = other_with_timeout_view(request, '21') 1279 self.assertEquals(response.content, 'Hello World 20') 1280 1281 # And if we wait a few more seconds 1282 time.sleep(2) 1283 1284 # the custom timeouot cache will miss 1285 response = other_with_timeout_view(request, '22') 1286 self.assertEquals(response.content, 'Hello World 22') 1271 1287 1272 1288 if __name__ == '__main__': 1273 1289 unittest.main()