Skip to content

Commit

Permalink
Fix poor choice of using '-' instead of '_'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Azakh993 committed Feb 18, 2024
1 parent 2b1c9d5 commit 55d7115
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
...
]
Expand Down
4 changes: 2 additions & 2 deletions app/models/competence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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
}
4 changes: 2 additions & 2 deletions tests/routes/test_competences_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tests/services/test_competences_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 55d7115

Please sign in to comment.