176 |
176 |
{'label': 'Field D', 'varname': 'fieldd', 'type': 'file'},
|
177 |
177 |
{'label': 'Field E', 'varname': 'fielde', 'type': 'text'},
|
178 |
178 |
{'label': 'Field F', 'varname': 'fieldf', 'type': 'text', 'pre': True},
|
|
179 |
{'label': 'Field G', 'varname': 'fieldg', 'type': 'email'},
|
179 |
180 |
{'label': 'Related', 'varname': 'related', 'type': 'item'},
|
180 |
181 |
{'label': 'Page', 'type': 'page'},
|
181 |
182 |
{'label': 'Comment', 'type': 'comment'},
|
... | ... | |
199 |
200 |
'fieldd': {'filename': 'file.pdf', 'url': 'http://127.0.0.1:8999/download?f=42'},
|
200 |
201 |
'fielde': 'lorem<strong>ipsum\n\nhello world',
|
201 |
202 |
'fieldf': 'lorem<strong>ipsum\n\nhello world',
|
|
203 |
'fieldg': 'test@localhost',
|
202 |
204 |
'related': 'Foo Bar',
|
203 |
205 |
'related_raw': 42,
|
204 |
206 |
'related_structured': {'id': 42, 'text': 'blah'},
|
... | ... | |
1903 |
1905 |
)
|
1904 |
1906 |
|
1905 |
1907 |
|
|
1908 |
@mock.patch('combo.apps.wcs.utils.requests.send', side_effect=mocked_requests_send)
|
|
1909 |
def test_card_cell_render_email_field(mock_send, context):
|
|
1910 |
page = Page.objects.create(title='xxx', template_name='standard')
|
|
1911 |
cell = WcsCardInfosCell(page=page, placeholder='content', order=0)
|
|
1912 |
cell.carddef_reference = 'default:card_model_1'
|
|
1913 |
cell.custom_title = 'Foo bar {{ card.fields.title }}'
|
|
1914 |
cell.save()
|
|
1915 |
|
|
1916 |
context['card_model_1_id'] = 11
|
|
1917 |
context['synchronous'] = True # to get fresh content
|
|
1918 |
|
|
1919 |
result = cell.render(context)
|
|
1920 |
|
|
1921 |
assert PyQuery(result).find('span.label:contains("Field G") + .value a').text() == 'test@localhost'
|
|
1922 |
|
|
1923 |
assert (
|
|
1924 |
PyQuery(result).find('span.label:contains("Field G") + .value a').attr['href']
|
|
1925 |
== 'mailto:test@localhost'
|
|
1926 |
)
|
|
1927 |
|
|
1928 |
|
1906 |
1929 |
@mock.patch('combo.apps.wcs.utils.requests.send', side_effect=mocked_requests_send)
|
1907 |
1930 |
def test_card_cell_render_identifier(mock_send, context, nocache):
|
1908 |
1931 |
page = Page.objects.create(title='xxx', template_name='standard')
|
1909 |
|
-
|