mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-28 13:30:59 +00:00
Add test for parent default block implementations
This commit is contained in:
parent
fc7be3c927
commit
aeac47cee0
@ -1,3 +1,4 @@
|
||||
{{ title }}
|
||||
{% block content %}{% endblock %}
|
||||
{% block foo %}Foo{% endblock %}
|
||||
Copyright 2017
|
||||
|
@ -18,11 +18,11 @@ struct ChildTemplate<'a> {
|
||||
#[test]
|
||||
fn test_use_base_directly() {
|
||||
let t = BaseTemplate { title: "Foo" };
|
||||
assert_eq!(t.render().unwrap(), "Foo\n\nCopyright 2017");
|
||||
assert_eq!(t.render().unwrap(), "Foo\n\nFoo\nCopyright 2017");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_simple_extends() {
|
||||
let t = ChildTemplate { _parent: BaseTemplate { title: "Bar" } };
|
||||
assert_eq!(t.render().unwrap(), "Bar\n(Bar) Content goes here\nCopyright 2017");
|
||||
assert_eq!(t.render().unwrap(), "Bar\n(Bar) Content goes here\nFoo\nCopyright 2017");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user