Skip to content

Commit a6b3123

Browse files
committed
Fix patch changing list-translations() ordering in tests
1 parent 869715c commit a6b3123

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/test_gettext.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,19 @@ def test_list_translations():
9191
b = babel.Babel(app, default_locale="de_DE")
9292

9393
with app.app_context():
94-
translations = b.list_translations()
94+
translations = sorted(b.list_translations(), key=str)
9595
assert len(translations) == 3
9696
assert str(translations[0]) == "de"
97-
assert str(translations[1]) == "ja"
98-
assert str(translations[2]) == "de_DE"
97+
assert str(translations[1]) == "de_DE"
98+
assert str(translations[2]) == "ja"
9999

100100

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

105105
with app.app_context():
106-
translations = b.list_translations()
106+
translations = sorted(b.list_translations(), key=str)
107107
assert len(translations) == 2
108108
assert str(translations[0]) == "de"
109109
assert str(translations[1]) == "ja"

tests/test_integration.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ def test_multiple_directories():
3838
b.init_app(app)
3939

4040
with app.test_request_context():
41-
translations = b.list_translations()
41+
translations = sorted(b.list_translations(), key=str)
4242

4343
assert len(translations) == 4
4444
assert str(translations[0]) == "de"
45-
assert str(translations[1]) == "ja"
46-
assert str(translations[2]) == "de"
47-
assert str(translations[3]) == "de_DE"
45+
assert str(translations[1]) == "de"
46+
assert str(translations[2]) == "de_DE"
47+
assert str(translations[3]) == "ja"
4848

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

0 commit comments

Comments
 (0)