0001-dataviz-change-message-when-page-variable-cannot-be-.patch
combo/apps/dataviz/views.py | ||
---|---|---|
82 | 82 |
except TemplateSyntaxError: |
83 | 83 |
return self.error(_('Syntax error in page variable.')) |
84 | 84 |
except VariableDoesNotExist: |
85 |
return self.error(_('Cannot evaluate page variable.'))
|
|
85 |
return self.error(_('Backoffice preview unavailable.'))
|
|
86 | 86 |
except HTTPError as e: |
87 | 87 |
if e.response.status_code == 404: |
88 | 88 |
return self.error(_('Visualization not found.')) |
tests/test_dataviz.py | ||
---|---|---|
2131 | 2131 | |
2132 | 2132 |
resp = app.get(location) |
2133 | 2133 |
assert len(new_api_mock.call['requests']) == 2 |
2134 |
assert 'Cannot evaluate page variable.' in resp.text
|
|
2134 |
assert 'Backoffice preview unavailable.' in resp.text
|
|
2135 | 2135 | |
2136 | 2136 |
# simulate call from page view |
2137 | 2137 |
app = login(app) |
... | ... | |
2190 | 2190 | |
2191 | 2191 |
resp = app.get(location) |
2192 | 2192 |
assert len(new_api_mock.call['requests']) == 1 |
2193 |
assert 'Cannot evaluate page variable.' in resp.text
|
|
2193 |
assert 'Backoffice preview unavailable.' in resp.text
|
|
2194 | 2194 | |
2195 | 2195 | |
2196 | 2196 |
def test_dataviz_check_validity(nocache): |
2197 |
- |