Browse Source

Fix test

index-subcmd
Vincent Prouillet 5 years ago
parent
commit
c503a9fe5d
2 changed files with 6 additions and 3 deletions
  1. +5
    -2
      components/library/src/taxonomies/mod.rs
  2. +1
    -1
      test_site_i18n/templates/tags/list.html

+ 5
- 2
components/library/src/taxonomies/mod.rs View File

@@ -169,7 +169,6 @@ impl Taxonomy {
self.items.iter().map(|i| SerializedTaxonomyItem::from_item(i, library)).collect(); self.items.iter().map(|i| SerializedTaxonomyItem::from_item(i, library)).collect();
context.insert("terms", &terms); context.insert("terms", &terms);
context.insert("taxonomy", &self.kind); context.insert("taxonomy", &self.kind);
context.insert("lang", &self.kind.lang);
context.insert("current_url", &config.make_permalink(&self.kind.name)); context.insert("current_url", &config.make_permalink(&self.kind.name));
context.insert("current_path", &self.kind.name); context.insert("current_path", &self.kind.name);


@@ -418,7 +417,11 @@ mod tests {
let mut a = None; let mut a = None;
for x in taxonomies { for x in taxonomies {
match x.kind.name.as_ref() { match x.kind.name.as_ref() {
"tags" => t = Some(x),
"tags" => {
if x.kind.lang == "en" {
t = Some(x)
}
},
"categories" => c = Some(x), "categories" => c = Some(x),
"auteurs" => a = Some(x), "auteurs" => a = Some(x),
_ => unreachable!(), _ => unreachable!(),


+ 1
- 1
test_site_i18n/templates/tags/list.html View File

@@ -1,3 +1,3 @@
{% for tag in terms %} {% for tag in terms %}
{{ tag.name }} {{ tag.slug }} {{ tag.pages | length }} {{ lang }}
{{ tag.name }} {{ tag.slug }} {{ tag.pages | length }} {{ taxonomy.lang }}
{% endfor %} {% endfor %}

Loading…
Cancel
Save