0001-misc-fix-user-dependant-cells-exported-in-skeleton-w.patch
combo/public/templatetags/combo.py | ||
---|---|---|
79 | 79 |
@register.simple_tag(takes_context=True) |
80 | 80 |
def render_cell(context, cell): |
81 | 81 |
if context.get('render_skeleton') and cell.is_user_dependant(context): |
82 |
context = flatten_context(context) |
|
82 | 83 |
return template.loader.get_template('combo/deferred-cell.html').render(context) |
83 | 84 | |
84 | 85 |
in_dashboard = False |
tests/test_lingo_cells.py | ||
---|---|---|
6 | 6 |
from django.contrib.auth.models import User |
7 | 7 |
from django.test.client import RequestFactory |
8 | 8 |
from django.utils import timezone |
9 |
from django.utils.http import quote |
|
9 | 10 | |
10 | 11 |
from combo.data.models import Page |
11 | 12 |
from combo.apps.lingo.models import Regie, BasketItem, Transaction |
... | ... | |
156 | 157 |
assert '12345' in content |
157 | 158 |
assert page.get_online_url() in content |
158 | 159 | |
160 |
def test_basket_link_cell_in_skeleton(app, regie, user): |
|
161 |
Page.objects.all().delete() |
|
162 |
page = Page(title='xxx', slug='test_basket_cell', template_name='standard') |
|
163 |
page.redirect_url = 'http://example.net/foo/' |
|
164 |
page.save() |
|
165 |
cell = LingoBasketLinkCell(page=page, placeholder='content', order=0) |
|
166 |
cell.save() |
|
167 |
resp = app.get('/__skeleton__/?source=%s' % quote('http://example.net/foo/bar')) |
|
168 | ||
159 | 169 |
def test_tipi_cell(): |
160 | 170 |
page = Page(title='example page', slug='example-page') |
161 | 171 |
page.save() |
162 |
- |