From 55d7115cf15d955798fa12e0cf663661e73a9728 Mon Sep 17 00:00:00 2001 From: "Azmeer K." Date: Sun, 18 Feb 2024 22:56:54 +0100 Subject: [PATCH] Fix poor choice of using '-' instead of '_'. --- README.md | 2 +- app/models/competence.py | 4 ++-- tests/routes/test_competences_route.py | 4 ++-- tests/services/test_competences_service.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 11427a4..4234ff1 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The API returns a list of competences with the following structure: [ { "competence_id": 0, - "i18n-key": "the-key" + "i18n_key": "the-key" }, ... ] diff --git a/app/models/competence.py b/app/models/competence.py index a9fc2f7..90e3a31 100644 --- a/app/models/competence.py +++ b/app/models/competence.py @@ -12,7 +12,7 @@ class Competence(database.Model): # type: ignore __tablename__ = 'competence' competence_id = database.Column(database.Integer, primary_key=True) - i18n_key = database.Column(database.String(255), name='i18n-key') + i18n_key = database.Column(database.String(255), name='i18n_key') def to_dict(self) -> dict: """ @@ -22,5 +22,5 @@ def to_dict(self) -> dict: """ return { 'competence_id': self.competence_id, - 'i18n-key': self.i18n_key + 'i18n_key': self.i18n_key } diff --git a/tests/routes/test_competences_route.py b/tests/routes/test_competences_route.py index 8521db9..e167205 100644 --- a/tests/routes/test_competences_route.py +++ b/tests/routes/test_competences_route.py @@ -16,8 +16,8 @@ def test_get_competences_success(app_with_client): '/api/application-form/competences/', headers={'Authorization': f'Bearer {token}'}) assert response.status_code == StatusCodes.OK - assert response.json == [{'competence_id': 1, 'i18n-key': 'tester'}, - {'competence_id': 2, 'i18n-key': 'developer'}] + assert response.json == [{'competence_id': 1, 'i18n_key': 'tester'}, + {'competence_id': 2, 'i18n_key': 'developer'}] remove_competences_from_db(app) diff --git a/tests/services/test_competences_service.py b/tests/services/test_competences_service.py index 1bb33cf..ad01343 100644 --- a/tests/services/test_competences_service.py +++ b/tests/services/test_competences_service.py @@ -13,8 +13,8 @@ def test_fetch_competences_success(app_with_client): setup_competences_in_db(app) with app.app_context(): result = fetch_competences() - assert result == [{'competence_id': 1, 'i18n-key': 'tester'}, - {'competence_id': 2, 'i18n-key': 'developer'}] + assert result == [{'competence_id': 1, 'i18n_key': 'tester'}, + {'competence_id': 2, 'i18n_key': 'developer'}] remove_competences_from_db(app)