Skip to content

Commit 43925fe

Browse files
committed
Update test to confirm french versions can be used for returning correct data see HEA-947
1 parent a704522 commit 43925fe

2 files changed

Lines changed: 28 additions & 50 deletions

File tree

apps/baseline/tests/test_viewsets.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,16 @@ def test_search_with_livelihood_strategy_type(self):
929929
self.assertEqual(len(baselines), 1)
930930
self.assertEqual(baselines[0]["id"], self.baseline2.id)
931931

932+
# Test that searching "lait" with language=fr matches MilkProduction via French translation
933+
response = self.client.get(self.url, {"search": "lait", "language": "fr"})
934+
self.assertEqual(response.status_code, 200)
935+
data = response.data
936+
strategy_type_results = data["livelihood_strategy_types"]
937+
milk_results = [r for r in strategy_type_results if r["value"] == "MilkProduction"]
938+
self.assertEqual(len(milk_results), 1)
939+
self.assertEqual(milk_results[0]["value_label"], "Production de lait")
940+
self.assertEqual(milk_results[0]["count"], 1)
941+
932942
# test taht strategy_type filter to baseline list endpoint
933943
baseline_url = reverse("livelihoodzonebaseline-list")
934944
response = self.client.get(baseline_url, {"strategy_type": "MilkProduction"})

apps/metadata/locale/fr/LC_MESSAGES/django.po

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,11 @@ msgstr "Catégorie de moyens de subsistance"
4646
msgid "Livelihood Categories"
4747
msgstr "Catégories de moyens de subsistance"
4848

49-
#, fuzzy
50-
#| msgid "Wealth Characteristic"
5149
msgid "Characteristic Group"
52-
msgstr "Caractéristique de la richesse"
50+
msgstr "Groupe de caractéristiques"
5351

54-
#, fuzzy
55-
#| msgid "Wealth Characteristics"
5652
msgid "Characteristic Groups"
57-
msgstr "Caractéristiques de la richesse"
53+
msgstr "Groupes de caractéristiques"
5854

5955
msgid "Numeric"
6056
msgstr "Numérique"
@@ -133,10 +129,10 @@ msgid "Fishing"
133129
msgstr "Pêche"
134130

135131
msgid "Wild Food Gathering"
136-
msgstr "Rassemblement des aliments sauvages"
132+
msgstr "Cueillette des aliments sauvages"
137133

138134
msgid "Other Cash Income"
139-
msgstr "Autres revenus en espèces"
135+
msgstr "Autre revenu en espèces"
140136

141137
msgid "Other Purchase"
142138
msgstr "Autre achat"
@@ -311,30 +307,20 @@ msgstr ""
311307
msgid "Ignore this label and associated data in the row"
312308
msgstr ""
313309

314-
#, fuzzy
315-
#| msgid "Livelihood Category"
316310
msgid "Livelihood Activity"
317-
msgstr "Catégorie de moyens de subsistance"
311+
msgstr "Activité de subsistance"
318312

319-
#, fuzzy
320-
#| msgid "Wild Food Gathering"
321313
msgid "Wild Foods, Fishing or Hunting"
322-
msgstr "Rassemblement des aliments sauvages"
314+
msgstr "Aliments sauvages, pêche ou chasse"
323315

324-
#, fuzzy
325-
#| msgid "Livelihood Category"
326316
msgid "Livelihood Summary"
327-
msgstr "Catégorie de moyens de subsistance"
317+
msgstr "Résumé des moyens de subsistance"
328318

329-
#, fuzzy
330-
#| msgid "Activity Category"
331319
msgid "Activity Label"
332-
msgstr "Catégorie d'activité"
320+
msgstr "Étiquette d'activité"
333321

334-
#, fuzzy
335-
#| msgid "Seasonal Activity Type"
336322
msgid "Activity Type"
337-
msgstr "Type d'activité saisonnière"
323+
msgstr "Type d'activité"
338324

339325
msgid ""
340326
"The type of Livelihood Activity the label is for: either a general "
@@ -346,45 +332,33 @@ msgstr ""
346332
msgid "Status"
347333
msgstr ""
348334

349-
#, fuzzy
350-
#| msgid "Start"
351335
msgid "Is Start?"
352-
msgstr "Commencer"
336+
msgstr "Marque le début ?"
353337

354338
msgid ""
355339
"Indicates whether this Activity Label marks the start of a new Livelihood "
356340
"Strategy"
357341
msgstr ""
358342

359-
#, fuzzy
360-
#| msgid "Milk Production"
361343
msgid "Livestock Production"
362-
msgstr "Production du lait"
344+
msgstr "Production animale"
363345

364-
#, fuzzy
365-
#| msgid "Variable Type"
366346
msgid "Strategy Type"
367-
msgstr "Type variable"
347+
msgstr "Type de stratégie"
368348

369349
msgid ""
370350
"The type of livelihood strategy, such as crop production, or wild food "
371351
"gathering."
372352
msgstr ""
373353

374-
#, fuzzy
375-
#| msgid "Has Product?"
376354
msgid "Product"
377-
msgstr "Le produit est-il disponible ?"
355+
msgstr "Produit"
378356

379-
#, fuzzy
380-
#| msgid "Meat Production"
381357
msgid "Payment Product"
382-
msgstr "Production de viande"
358+
msgstr "Produit de paiement"
383359

384-
#, fuzzy
385-
#| msgid "Has Unit Of Measure?"
386360
msgid "Unit of Measure"
387-
msgstr "A une unité de mesure ?"
361+
msgstr "Unité de mesure"
388362

389363
msgid "Currency"
390364
msgstr ""
@@ -398,23 +372,17 @@ msgstr ""
398372
msgid "Notes"
399373
msgstr ""
400374

401-
#, fuzzy
402-
#| msgid "Activity Category"
403375
msgid "Activity Labels"
404-
msgstr "Catégorie d'activité"
376+
msgstr "Étiquettes d'activité"
405377

406378
msgid "Complete"
407379
msgstr ""
408380

409-
#, fuzzy
410-
#| msgid "Wealth Characteristic"
411381
msgid "Wealth Characteristic Label"
412-
msgstr "Caractéristique de la richesse"
382+
msgstr "Étiquette de caractéristique de richesse"
413383

414-
#, fuzzy
415-
#| msgid "Wealth Characteristics"
416384
msgid "Wealth Characteristics Labels"
417-
msgstr "Caractéristiques de la richesse"
385+
msgstr "Étiquettes des caractéristiques de richesse"
418386

419387
msgid "Filter"
420388
msgstr ""

0 commit comments

Comments
 (0)