Skip to content

Commit

Permalink
Add explicit locale during tests
Browse files Browse the repository at this point in the history
This hopefully fixes an issue in travis where the locale would sometimes
change to German during the different tests.
  • Loading branch information
rolandgeider committed Jun 28, 2020
1 parent dcd3163 commit 3d2def5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wger/core/tests/base_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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
Expand Down Expand Up @@ -129,6 +130,9 @@ def setUp(self):
# 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',)
Expand Down

0 comments on commit 3d2def5

Please sign in to comment.