test: Add test case to check breadcrumbs
This commit is contained in:
parent
d13eac6f50
commit
9ec451b28e
6 changed files with 16 additions and 6 deletions
|
|
@ -3,11 +3,6 @@
|
|||
{% for item in children_map[route] %}
|
||||
<li>
|
||||
<a href="{{ url_prefix }}{{ item.route }}">{{ item.title }}</a>
|
||||
{#
|
||||
{% if children_map[item.route] %}
|
||||
{{ make_item_list(item.route, children_map) }}
|
||||
{% endif %}
|
||||
#}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
{%- endblock -%}
|
||||
</head>
|
||||
<body>
|
||||
{% include "templates/includes/breadcrumbs.html" %}
|
||||
<h1>This is for testing</h1>
|
||||
{% block content %}{% endblock %}
|
||||
{%- block script %}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,13 @@ class TestWebPage(unittest.TestCase):
|
|||
frappe.as_unicode(content))
|
||||
|
||||
def test_breadcrumbs(self):
|
||||
pass
|
||||
content = get_response_content('/_test/_test_folder/_test_page')
|
||||
self.assertIn('<span itemprop="name">Test TOC</span>', content)
|
||||
self.assertIn('<span itemprop="name"> Test Page</span>', content)
|
||||
|
||||
content = get_response_content('/_test/_test_folder/index')
|
||||
self.assertIn('<span itemprop="name"> Test</span>', content)
|
||||
self.assertIn('<span itemprop="name">Test TOC</span>', content)
|
||||
|
||||
def test_downloadable_file(self):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
def get_context(context):
|
||||
context.base_template_path = 'frappe/templates/test/_test_base.html'
|
||||
context.add_breadcrumbs = 1
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
---
|
||||
title: Test TOC
|
||||
add_breadcrumbs: 1
|
||||
show_sidebar: 1
|
||||
---
|
||||
|
||||
# Index
|
||||
|
||||
{index}
|
||||
1
frappe/www/_test/index.html
Normal file
1
frappe/www/_test/index.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{index}
|
||||
Loading…
Add table
Reference in a new issue