diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-05-20 21:05:45 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-05-20 21:05:58 +0200 |
commit | 60950c97debc6c141e5252519d45f2da51572cb5 (patch) | |
tree | a6d412ad32b0749294dfb454a5ab8e1c1b1aeae8 /testing | |
parent | 0fb0c610cbbddd42daa6d9cd71b2dae0328bd7a8 (diff) | |
download | askama-60950c97debc6c141e5252519d45f2da51572cb5.tar.gz askama-60950c97debc6c141e5252519d45f2da51572cb5.tar.bz2 askama-60950c97debc6c141e5252519d45f2da51572cb5.zip |
Add support for nested blocks (fixes #85)
Diffstat (limited to '')
-rw-r--r-- | testing/tests/inheritance.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/tests/inheritance.rs b/testing/tests/inheritance.rs index a36f634..80fa457 100644 --- a/testing/tests/inheritance.rs +++ b/testing/tests/inheritance.rs @@ -58,3 +58,21 @@ fn test_different_module() { "a\n(a) Content goes here\nFoo\nCopyright 2017" ); } + + + +#[derive(Template)] +#[template(path = "nested-base.html", print = "code")] +struct NestedBaseTemplate {} + +#[derive(Template)] +#[template(path = "nested-child.html", print = "code")] +struct NestedChildTemplate { + _parent: NestedBaseTemplate, +} + +#[test] +fn test_nested_blocks() { + let t = NestedChildTemplate { _parent: NestedBaseTemplate {} }; + assert_eq!(t.render().unwrap(), "\ndurpy\n"); +} |