Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add explicit locale during tests

Roland3d2def5f1dcd
diff --git a/wger/core/tests/base_testcase.py b/wger/core/tests/base_testcase.py
index e94b48bd8..ac8d9157d 100644
--- a/wger/core/tests/base_testcase.py
+++ b/wger/core/tests/base_testcase.py
@@ -23,6 +23,7 @@ import tempfile
from django.conf import settings
from django.core.cache import cache
from django.test import TestCase
+from django.utils.translation import activate
from django.urls import (
NoReverseMatch,
reverse
@@ -129,6 +130,9 @@ class BaseTestCase(object):
# Don't check reCaptcha's entries
os.environ['RECAPTCHA_TESTING'] = 'True'
+ # Explicitly set the locale to en, otherwise the CI might make problems
+ activate('en')
+
# Test the mobile templates
if os.environ.get('TEST_MOBILE') == 'True':
settings.FLAVOURS = ('mobile',)