aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-05 15:18:47 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-05 15:18:47 +0100
commit723567ba0c8d28a292b87d6d65cb97e4b4406e4b (patch)
tree0e27ef09553e55acff4789260928080e9c911c23 /testing/tests
parent2355f4eb0b8fb33ef2d0994f4f54aa2615b8fa29 (diff)
downloadaskama-723567ba0c8d28a292b87d6d65cb97e4b4406e4b.tar.gz
askama-723567ba0c8d28a292b87d6d65cb97e4b4406e4b.tar.bz2
askama-723567ba0c8d28a292b87d6d65cb97e4b4406e4b.zip
Implement basic support for template inheritance
Diffstat (limited to '')
-rw-r--r--testing/tests/inheritance.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/tests/inheritance.rs b/testing/tests/inheritance.rs
new file mode 100644
index 0000000..ebcca70
--- /dev/null
+++ b/testing/tests/inheritance.rs
@@ -0,0 +1,19 @@
+extern crate askama;
+#[macro_use]
+extern crate askama_derive;
+
+use askama::Template;
+
+#[derive(Template)]
+#[template(path = "base.html")]
+struct BaseTemplate { }
+
+#[derive(Template)]
+#[template(path = "child.html")]
+struct ChildTemplate { }
+
+#[test]
+fn test_simple_extends() {
+ let t = ChildTemplate { };
+ assert_eq!(t.render(), "Content goes here\nCopyright 2017\n");
+}