From 723567ba0c8d28a292b87d6d65cb97e4b4406e4b Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sun, 5 Feb 2017 15:18:47 +0100 Subject: Implement basic support for template inheritance --- testing/tests/inheritance.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 testing/tests/inheritance.rs (limited to 'testing/tests') 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"); +} -- cgit