Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/test_gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ def test_list_translations():
b = babel.Babel(app, default_locale="de_DE")

with app.app_context():
translations = b.list_translations()
translations = sorted(b.list_translations(), key=str)
assert len(translations) == 3
assert str(translations[0]) == "de"
assert str(translations[1]) == "ja"
assert str(translations[2]) == "de_DE"
assert str(translations[1]) == "de_DE"
assert str(translations[2]) == "ja"


def test_list_translations_default_locale_exists():
app = flask.Flask(__name__)
b = babel.Babel(app, default_locale="de")

with app.app_context():
translations = b.list_translations()
translations = sorted(b.list_translations(), key=str)
assert len(translations) == 2
assert str(translations[0]) == "de"
assert str(translations[1]) == "ja"
Expand Down
8 changes: 4 additions & 4 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ def test_multiple_directories():
b.init_app(app)

with app.test_request_context():
translations = b.list_translations()
translations = sorted(b.list_translations(), key=str)

assert len(translations) == 4
assert str(translations[0]) == "de"
assert str(translations[1]) == "ja"
assert str(translations[2]) == "de"
assert str(translations[3]) == "de_DE"
assert str(translations[1]) == "de"
assert str(translations[2]) == "de_DE"
assert str(translations[3]) == "ja"

assert gettext("Hello %(name)s!", name="Peter") == "Hallo Peter!"

Expand Down