855 |
855 |
{'varname': 'fieldf'},
|
856 |
856 |
{'varname': 'fieldg'},
|
857 |
857 |
{'varname': 'fieldh'},
|
|
858 |
{'varname': 'fieldi'},
|
858 |
859 |
{'varname': 'unknown'},
|
859 |
860 |
{'varname': 'user:name'},
|
860 |
861 |
{'varname': 'user:email'},
|
... | ... | |
867 |
868 |
|
868 |
869 |
result = cell.render(context)
|
869 |
870 |
assert PyQuery(result).find('ul li') == []
|
870 |
|
assert len(PyQuery(result).find('table tr td')) == 13 * 3
|
|
871 |
assert len(PyQuery(result).find('table tr td')) == 14 * 3
|
871 |
872 |
assert [PyQuery(td).text() for td in PyQuery(result).find('table tr:first-child td')] == [
|
872 |
873 |
'<i>a</i>',
|
873 |
874 |
'yes',
|
... | ... | |
878 |
879 |
"lorem<strong>ipsum hello world",
|
879 |
880 |
'test@localhost',
|
880 |
881 |
'https://www.example.net/',
|
|
882 |
"loremipsum\nhello'world",
|
881 |
883 |
'User Foo Bar',
|
882 |
884 |
'foo@bar.com',
|
883 |
885 |
'User',
|
... | ... | |
895 |
897 |
PyQuery(result).find('table tr:first-child td:nth-child(9) a').attr['href']
|
896 |
898 |
== 'https://www.example.net/'
|
897 |
899 |
)
|
898 |
|
assert PyQuery(result).find('table tr:first-child td:nth-child(11) a').text().strip() == 'foo@bar.com'
|
|
900 |
assert PyQuery(result).find('table tr:first-child td:nth-child(10) p:first-child').text() == 'loremipsum'
|
899 |
901 |
assert (
|
900 |
|
PyQuery(result).find('table tr:first-child td:nth-child(11) a').attr['href'] == 'mailto:foo@bar.com'
|
|
902 |
PyQuery(result).find('table tr:first-child td:nth-child(10) p:first-child strong').text() == 'ipsum'
|
|
903 |
)
|
|
904 |
assert PyQuery(result).find('table tr:first-child td:nth-child(10) p:last-child').text() == "hello'world"
|
|
905 |
assert PyQuery(result).find('table tr:first-child td:nth-child(12) a').text().strip() == 'foo@bar.com'
|
|
906 |
assert (
|
|
907 |
PyQuery(result).find('table tr:first-child td:nth-child(12) a').attr['href'] == 'mailto:foo@bar.com'
|
901 |
908 |
)
|
902 |
909 |
|
903 |
910 |
|
... | ... | |
1737 |
1744 |
assert PyQuery(result).find('.label').text() == 'Field F'
|
1738 |
1745 |
assert PyQuery(result).find('.value pre').text() == 'lorem<strong>ipsum hello world'
|
1739 |
1746 |
|
|
1747 |
cell.custom_schema['cells'][0] = {
|
|
1748 |
'varname': 'fieldi',
|
|
1749 |
'field_content': 'label-and-value',
|
|
1750 |
'display_mode': 'text',
|
|
1751 |
}
|
|
1752 |
cell.save()
|
|
1753 |
result = cell.render(context)
|
|
1754 |
assert PyQuery(result).find('.label').text() == 'Field I'
|
|
1755 |
assert PyQuery(result).find('.value p:first-child').text() == 'loremipsum'
|
|
1756 |
assert PyQuery(result).find('.value p:first-child strong').text() == 'ipsum'
|
|
1757 |
assert PyQuery(result).find('.value p:last-child').text() == "hello'world"
|
|
1758 |
|
1740 |
1759 |
cell.custom_schema['cells'][0] = {
|
1741 |
1760 |
'varname': 'fieldg',
|
1742 |
1761 |
'field_content': 'label-and-value',
|