Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TJTS5901 K23 Template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Startuplab
Courses
TJTS5901 Continuous Software Engineering
TJTS5901 K23 Template
Commits
a9b4382c
Commit
a9b4382c
authored
2 years ago
by
Teemu Autto
Browse files
Options
Downloads
Plain Diff
Merge branch 'pytest-fix'
parents
0c9d398e
67ead239
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#14765
failed
2 years ago
Stage: build
Stage: test
Stage: staging
Stage: smoketest
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_i18n.py
+5
-3
5 additions, 3 deletions
tests/test_i18n.py
with
5 additions
and
3 deletions
tests/test_i18n.py
+
5
−
3
View file @
a9b4382c
...
...
@@ -21,13 +21,15 @@ from tjts5901.i18n import SupportedLocales
from
tjts5901
import
__file__
as
pkg_file
@pytest.fixture
def
babel
(
app
:
Flask
)
->
Babel
:
def
babel
(
app
:
Flask
):
"""
Babel translation fixture.
Returns babel tranlaslation fixture registered in flask app
"""
yield
app
.
extensions
[
'
babel
'
].
instance
with
app
.
app_context
():
yield
app
.
extensions
[
'
babel
'
].
instance
def
test_for_supported_locales
(
app
:
Flask
,
babel
:
Babel
):
...
...
@@ -99,7 +101,7 @@ def test_app_language_detection(client, babel):
response
=
client
.
get
(
'
/hello
'
,
headers
=
{
'
Accept-Language
'
:
locale
.
language
})
resp_as_string
=
response
.
data
.
decode
(
'
utf-8
'
)
assert
gettext
(
"
Hello, World!
"
)
!
=
resp_as_string
,
f
"
Message is not translated for language
{
locale
.
language
}
"
assert
gettext
(
"
Hello, World!
"
)
=
=
resp_as_string
,
f
"
Message is not translated for language
{
locale
.
language
}
"
@pytest.fixture
(
scope
=
"
session
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment