From e559ed42102d425f23701e061cdea509a0f325b4 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 7 Sep 2017 20:42:54 +0200 Subject: Move JSON test into filters test module --- testing/tests/simple.rs | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'testing/tests/simple.rs') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 93faf50..eac7c4b 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -1,10 +1,8 @@ #[macro_use] extern crate askama; -#[macro_use] -extern crate serde_json; use askama::Template; -use serde_json::Value; + #[derive(Template)] #[template(path = "simple.html")] @@ -145,31 +143,6 @@ fn test_generics() { } -#[derive(Template)] -#[template(path = "json.html")] -struct JsonTemplate<'a> { - foo: &'a str, - bar: &'a Value, -} - -#[test] -fn test_json() { - let val = json!({"arr": [ "one", 2, true, null ]}); - let t = JsonTemplate { foo: "a", bar: &val }; - // Note: the json filter lacks a way to specify initial indentation - assert_eq!(t.render().unwrap(), r#"{ - "foo": "a", - "bar": { - "arr": [ - "one", - 2, - true, - null - ] -} -}"#); -} - #[derive(Template)] #[template(path = "composition.html")] struct CompositionTemplate { -- cgit