diff --git a/testing/templates/deep-base.html b/testing/templates/deep-base.html
new file mode 100644
index 00000000..0d874ac4
--- /dev/null
+++ b/testing/templates/deep-base.html
@@ -0,0 +1,14 @@
+{% import "macro.html" as libb %}
+
+
+ {% block head %}
+
+ {% endblock %}
+
+
+ {% block body %}
+ {% call libb::thrice("nav") %}
+ Copyright {{ year }}
+ {% endblock %}
+
+
diff --git a/testing/templates/deep-kid.html b/testing/templates/deep-kid.html
new file mode 100644
index 00000000..a2aa1052
--- /dev/null
+++ b/testing/templates/deep-kid.html
@@ -0,0 +1,10 @@
+{% extends "deep-mid.html" %}
+{% import "macro.html" as libk %}
+
+{% block head %}
+
+{% endblock %}
+
+{% block content %}
+ {% call libk::thrice(item) %}
+{% endblock %}
diff --git a/testing/templates/deep-mid.html b/testing/templates/deep-mid.html
new file mode 100644
index 00000000..76ab7e6c
--- /dev/null
+++ b/testing/templates/deep-mid.html
@@ -0,0 +1,19 @@
+{% extends "deep-base.html" %}
+{% import "macro.html" as libm %}
+
+{% block head %}
+ {{ title }}
+{% endblock %}
+
+{% block body %}
+
+
+ {% block content %}
+ No content found
+ {% endblock %}
+
+
+ {% call libm::thrice("nav") %}
+
+
+{% endblock %}
diff --git a/testing/tests/inheritance.rs b/testing/tests/inheritance.rs
index 2fd69c6b..9efbd62f 100644
--- a/testing/tests/inheritance.rs
+++ b/testing/tests/inheritance.rs
@@ -79,3 +79,95 @@ fn test_nested_blocks() {
};
assert_eq!(t.render().unwrap(), "\ndurpy\n");
}
+
+#[derive(Template)]
+#[template(path = "deep-base.html")]
+struct DeepBaseTemplate {
+ year: u16,
+}
+
+#[derive(Template)]
+#[template(path = "deep-mid.html")]
+struct DeepMidTemplate {
+ _parent: DeepBaseTemplate,
+ title: String,
+}
+
+#[derive(Template)]
+#[template(path = "deep-kid.html")]
+struct DeepKidTemplate {
+ _parent: DeepMidTemplate,
+ item: String,
+}
+
+#[test]
+fn test_deep() {
+ let t = DeepKidTemplate {
+ _parent: DeepMidTemplate {
+ _parent: DeepBaseTemplate {
+ year: 2018,
+ },
+ title: "Test".into(),
+ },
+ item: "Foo".into(),
+ };
+
+ assert_eq!(t.render().unwrap(), "
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+");
+ assert_eq!(t._parent.render().unwrap(), "
+
+
+
+ Test
+
+
+
+
+
+
+
+
+
+
+");
+ assert_eq!(t._parent._parent.render().unwrap(), "
+
+
+
+
+
+
+
+
+ nav nav nav
+ Copyright 2018
+
+
+");
+}