Skip to content

Commit

Permalink
fix: use Locale and DocumentFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
fbraem committed Sep 21, 2023
1 parent 30713b9 commit d9a3fc7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backend/src/tests/core/domain/value_objects/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
from kwai.core.domain.value_objects.identifier import IntIdentifier
from kwai.core.domain.value_objects.name import Name
from kwai.core.domain.value_objects.owner import Owner
from kwai.core.domain.value_objects.text import LocaleText, Text
from kwai.core.domain.value_objects.text import DocumentFormat, Locale, LocaleText, Text
from kwai.core.domain.value_objects.unique_id import UniqueId


@pytest.fixture()
def content(locale: str):
def content(locale: Locale):
"""Create a fixture for Content."""
return LocaleText(
locale=locale,
format="MD",
format=DocumentFormat.MARKDOWN,
title="Test",
content="Test",
summary="Test",
Expand All @@ -27,7 +27,7 @@ def content(locale: str):
)


@pytest.mark.parametrize("locale", ["nl"])
@pytest.mark.parametrize("locale", [Locale.NL])
def test_add_translation(locale, request):
"""Test the add_translation method."""
content = request.getfixturevalue("content")
Expand All @@ -37,7 +37,7 @@ def test_add_translation(locale, request):
), f"There should be a translation available for {locale}"


@pytest.mark.parametrize("locale", ["nl"])
@pytest.mark.parametrize("locale", [Locale.NL])
def test_remove_translation(locale, request):
"""Test the remove_translation method."""
content = request.getfixturevalue("content")
Expand All @@ -47,7 +47,7 @@ def test_remove_translation(locale, request):
), f"There should be no translation available for {locale}"


@pytest.mark.parametrize("locale", ["nl"])
@pytest.mark.parametrize("locale", [Locale.NL])
def test_replace_translation(locale, request):
"""Test the replace_translation method."""
content = request.getfixturevalue("content")
Expand Down

0 comments on commit d9a3fc7

Please sign in to comment.