feat(backend): drop dictionary dialect columns, add allowed_languages
- Removes source_dialect and target_dialect from TerminologyDictionary model, schemas, routes, helper serialization, and all tests - Adds allowed_languages config field (BCP-47 language codes) to GlobalSettings with validation, consolidated settings response, and API endpoint - Adds alembic migration f1a2b3c4d5e6 to drop the two columns
This commit is contained in:
@@ -105,7 +105,7 @@ def client(mock_api_deps):
|
||||
def test_submit_correction_creates_entry(db_session):
|
||||
"""Test that submitting a correction creates a new entry."""
|
||||
dict_obj = DictionaryManager.create_dictionary(
|
||||
db_session, name="Test Dict", source_dialect="en", target_dialect="ru",
|
||||
db_session, name="Test Dict",
|
||||
created_by="testuser",
|
||||
)
|
||||
|
||||
@@ -138,7 +138,7 @@ def test_submit_correction_creates_entry(db_session):
|
||||
def test_submit_correction_conflict_detected(db_session):
|
||||
"""Test that conflict is detected when entry already exists."""
|
||||
dict_obj = DictionaryManager.create_dictionary(
|
||||
db_session, name="Dict", source_dialect="en", target_dialect="ru",
|
||||
db_session, name="Dict",
|
||||
)
|
||||
|
||||
# Create initial entry
|
||||
@@ -165,7 +165,7 @@ def test_submit_correction_conflict_detected(db_session):
|
||||
def test_submit_correction_overwrite(db_session):
|
||||
"""Test that correction overwrites existing entry."""
|
||||
dict_obj = DictionaryManager.create_dictionary(
|
||||
db_session, name="Dict", source_dialect="en", target_dialect="ru",
|
||||
db_session, name="Dict",
|
||||
)
|
||||
|
||||
DictionaryManager.add_entry(db_session, dict_obj.id, "hello", "privet")
|
||||
@@ -190,7 +190,7 @@ def test_submit_correction_overwrite(db_session):
|
||||
def test_bulk_corrections_atomic(db_session):
|
||||
"""Test that bulk corrections are applied atomically."""
|
||||
dict_obj = DictionaryManager.create_dictionary(
|
||||
db_session, name="Bulk Dict", source_dialect="en", target_dialect="ru",
|
||||
db_session, name="Bulk Dict",
|
||||
)
|
||||
|
||||
corrections = [
|
||||
@@ -233,7 +233,7 @@ def test_api_bulk_corrections(client, mock_api_deps):
|
||||
"""Test bulk corrections endpoint."""
|
||||
session = mock_api_deps["session"]
|
||||
dict_obj = DictionaryManager.create_dictionary(
|
||||
session, name="API Dict", source_dialect="en", target_dialect="ru",
|
||||
session, name="API Dict",
|
||||
)
|
||||
|
||||
response = client.post("/api/translate/corrections/bulk", json={
|
||||
|
||||
Reference in New Issue
Block a user