##// END OF EJS Templates
tests: remove usage of pylons context var in home app test.
marcink -
r1893:eb462cc2 default
parent child Browse files
Show More
@@ -54,14 +54,15 b' class TestHomeController(TestController)'
54 54 response.mustcontain('"name_raw": "%s"' % repo.repo_name)
55 55
56 56 def test_index_contains_statics_with_ver(self):
57 from pylons import tmpl_context as c
57 from rhodecode.lib.base import calculate_version_hash
58 58
59 59 self.log_user()
60 60 response = self.app.get(route_path('home'))
61 61
62 rhodecode_version_hash = c.rhodecode_version_hash
62 rhodecode_version_hash = calculate_version_hash()
63 63 response.mustcontain('style.css?ver={0}'.format(rhodecode_version_hash))
64 response.mustcontain('rhodecode-components.js?ver={0}'.format(rhodecode_version_hash))
64 response.mustcontain('rhodecode-components.js?ver={0}'.format(
65 rhodecode_version_hash))
65 66
66 67 def test_index_contains_backend_specific_details(self, backend):
67 68 self.log_user()
@@ -266,6 +266,12 b' class BasicAuth(AuthBasicAuthenticator):'
266 266
267 267
268 268 def attach_context_attributes(context, request, user_id, attach_to_request=False):
269 def calculate_version_hash():
270 return md5(
271 config.get('beaker.session.secret', '') +
272 rhodecode.__version__)[:8]
273
274
269 275 """
270 276 Attach variables into template context called `c`, please note that
271 277 request could be pylons or pyramid request in here.
@@ -275,9 +281,7 b' def attach_context_attributes(context, r'
275 281 context.rhodecode_version = rhodecode.__version__
276 282 context.rhodecode_edition = config.get('rhodecode.edition')
277 283 # unique secret + version does not leak the version but keep consistency
278 context.rhodecode_version_hash = md5(
279 config.get('beaker.session.secret', '') +
280 rhodecode.__version__)[:8]
284 context.rhodecode_version_hash = calculate_version_hash()
281 285
282 286 # Default language set for the incoming request
283 287 context.language = translation.get_lang()[0]
General Comments 0
You need to be logged in to leave comments. Login now