From c503a9fe5d7e7e4be8565aabdfa23cc856606311 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Sat, 10 Aug 2019 19:09:29 +0200 Subject: [PATCH] Fix test --- components/library/src/taxonomies/mod.rs | 7 +++++-- test_site_i18n/templates/tags/list.html | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/library/src/taxonomies/mod.rs b/components/library/src/taxonomies/mod.rs index 5cd672ed..0bea5127 100644 --- a/components/library/src/taxonomies/mod.rs +++ b/components/library/src/taxonomies/mod.rs @@ -169,7 +169,6 @@ impl Taxonomy { self.items.iter().map(|i| SerializedTaxonomyItem::from_item(i, library)).collect(); context.insert("terms", &terms); context.insert("taxonomy", &self.kind); - context.insert("lang", &self.kind.lang); context.insert("current_url", &config.make_permalink(&self.kind.name)); context.insert("current_path", &self.kind.name); @@ -418,7 +417,11 @@ mod tests { let mut a = None; for x in taxonomies { match x.kind.name.as_ref() { - "tags" => t = Some(x), + "tags" => { + if x.kind.lang == "en" { + t = Some(x) + } + }, "categories" => c = Some(x), "auteurs" => a = Some(x), _ => unreachable!(), diff --git a/test_site_i18n/templates/tags/list.html b/test_site_i18n/templates/tags/list.html index 734bfff0..18d6d50d 100644 --- a/test_site_i18n/templates/tags/list.html +++ b/test_site_i18n/templates/tags/list.html @@ -1,3 +1,3 @@ {% for tag in terms %} - {{ tag.name }} {{ tag.slug }} {{ tag.pages | length }} {{ lang }} + {{ tag.name }} {{ tag.slug }} {{ tag.pages | length }} {{ taxonomy.lang }} {% endfor %}