file-browser: refactor how we load metadata for file trees.

Before we used to use JSON data to map the nodes to json and fill in
metadata. Now we use rendered parts of html. This is nicer for caching as
it would allow us to replace the view with cached tree and then after ajax load
replace it again with cached with metadata. On the next request we'll
get the cached with metadata and thus we can skip entirely second
ajax call for metadata.

This is part of #4083
This commit is contained in:
Marcin Kuzminski 2016-07-12 11:45:51 +02:00
parent e22bef75b4
commit f48e94aa14
9 changed files with 98 additions and 82 deletions

View file

@ -171,6 +171,9 @@ class AssertResponse(object):
assert len(elements) == 1
return elements[0]
def get_elements(self, css_selector):
return self._get_elements(css_selector)
def _get_elements(self, css_selector):
doc = fromstring(self.response.body)
sel = CSSSelector(css_selector)