don't cache buttons, they depend on more than the object
This commit is contained in:
Родитель
32e15272a9
Коммит
009480efd2
|
@ -1,7 +1,6 @@
|
|||
{% set b = button %}
|
||||
{% set compat = addon.compatible_apps[APP] %}
|
||||
|
||||
{% cache addon %}
|
||||
<div class="install-shell">
|
||||
<div class="install {{ b.install_class|join(' ') }}"
|
||||
data-addon="{{ addon.id }}"
|
||||
|
@ -41,4 +40,3 @@
|
|||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endcache %}
|
||||
|
|
|
@ -342,3 +342,12 @@ class TestButtonHtml(ButtonTest):
|
|||
install = self.render()('.install')
|
||||
eq_('min version', install.attr('data-min'))
|
||||
eq_('max version', install.attr('data-max'))
|
||||
|
||||
def test_caching(self):
|
||||
"""Make sure we don't cache too hard and ignore flags."""
|
||||
self.addon.has_eula = True
|
||||
doc = self.render()
|
||||
assert doc('.button').hasClass('eula')
|
||||
|
||||
doc = self.render(show_eula=False)
|
||||
assert not doc('.button').hasClass('eula')
|
||||
|
|
Загрузка…
Ссылка в новой задаче