diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-03-08 15:00:06 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-06-17 13:21:27 +0200 |
commit | 7e137ffa0fbf2a017607963c83a21355c7b87804 (patch) | |
tree | ce0b6b0daa123676825322bb63b3d594ed0eb04e | |
parent | 71a3fc4f3af6ddddd570c1a8f7cb11ad3805d558 (diff) | |
download | Ishtar-7e137ffa0fbf2a017607963c83a21355c7b87804.tar.bz2 Ishtar-7e137ffa0fbf2a017607963c83a21355c7b87804.zip |
Tests: force locale definition
-rw-r--r-- | .gitlab-ci.yml | 3 | ||||
-rw-r--r-- | archaeological_context_records/tests.py | 2 | ||||
-rw-r--r-- | archaeological_operations/tests.py | 2 |
3 files changed, 7 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eea913262..65246de14 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,9 @@ before_script: - apt update - apt install -q -y git python3-pip libpq-dev python3-dev libjpeg-dev zlib1g-dev libxml2-dev libxslt1-dev libgeos-dev python3-cairocffi tidy libtidy-dev binutils libproj-dev gdal-bin libpangocairo-1.0-0 pandoc + - apt-get install -q -y locales && \ + sed -i -e "s/# fr_FR*/fr_FR.UTF-8 UTF-8/" /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=$LANG - pip3 install -r requirements.txt - cp Makefile.example Makefile - cp example_project/local_settings.py.gitlab-ci example_project/local_settings.py diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py index fe9fab7fb..adfb56b01 100644 --- a/archaeological_context_records/tests.py +++ b/archaeological_context_records/tests.py @@ -20,6 +20,7 @@ import csv import json from io import StringIO +import locale from django.conf import settings from django.contrib.auth.models import Permission @@ -84,6 +85,7 @@ class ImportContextRecordTest(ImportTest, TestCase): unit__txt_idx='negative').count(), 1) def test_model_limitation(self): + locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') old_nb = models.ContextRecord.objects.count() mcc, form = self.init_context_record_import() mcc.created_models.clear() diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 65cc0c316..54386135c 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -22,6 +22,7 @@ import datetime from subprocess import Popen, PIPE from io import StringIO, BytesIO import tempfile +import locale import zipfile from django.conf import settings @@ -1336,6 +1337,7 @@ class OperationTest(TestCase, OperationInitTest): self.assertTrue(filetype.startswith(b'application/pdf')) def test_show_odt(self): + locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') operation = self.operations[0] c = Client() response = c.get(reverse('show-operation', |