aboutsummaryrefslogtreecommitdiffstats
path: root/askama_iron/tests/basic.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2021-08-05 11:51:00 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2021-08-05 13:16:44 +0200
commit23df4c5b9e5b7fc6b1116dd74a6168419a54d658 (patch)
tree16781f269b39bebcc56fb14b445fdc9e0ac5319a /askama_iron/tests/basic.rs
parentd45e106bf219d6da94538e2816472ca8026500ba (diff)
downloadaskama-23df4c5b9e5b7fc6b1116dd74a6168419a54d658.tar.gz
askama-23df4c5b9e5b7fc6b1116dd74a6168419a54d658.tar.bz2
askama-23df4c5b9e5b7fc6b1116dd74a6168419a54d658.zip
Remove the askama_iron integration
This web framework seems not to have been updated for quite a while, and its current version appears to depend on vulnerable crates. Remove it for now. If someone wants to fix up Iron upstream and reinstate this, I'd be happy to review your PR.
Diffstat (limited to 'askama_iron/tests/basic.rs')
-rw-r--r--askama_iron/tests/basic.rs36
1 files changed, 0 insertions, 36 deletions
diff --git a/askama_iron/tests/basic.rs b/askama_iron/tests/basic.rs
deleted file mode 100644
index 32ca839..0000000
--- a/askama_iron/tests/basic.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-use askama::Template;
-use iron::{status, Response};
-
-#[derive(Template)]
-#[template(path = "hello.html")]
-struct HelloTemplate<'a> {
- name: &'a str,
-}
-
-#[derive(Template)]
-#[template(path = "hello.txt")]
-struct HelloTextTemplate<'a> {
- name: &'a str,
-}
-
-#[test]
-fn test_iron() {
- let rsp = Response::with((status::Ok, HelloTemplate { name: "world" }));
- let mut buf = Vec::new();
- let _ = rsp.body.unwrap().write_body(&mut buf);
- assert_eq!(buf, b"Hello, world!");
-
- let content_type = rsp.headers.get::<iron::headers::ContentType>().unwrap();
- assert_eq!(format!("{}", content_type), "text/html; charset=utf-8");
-}
-
-#[test]
-fn test_iron_non_html() {
- let rsp = Response::with((status::Ok, HelloTextTemplate { name: "world" }));
- let mut buf = Vec::new();
- let _ = rsp.body.unwrap().write_body(&mut buf);
- assert_eq!(buf, b"Hello, world!");
-
- let content_type = rsp.headers.get::<iron::headers::ContentType>();
- assert_eq!(content_type, None);
-}