Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/utils/countrycodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,11 @@ def country_code(country):
country = synonyms[country]

# Get country or fallback to default_code.
return is_3166_1.get(country, default_code)
country_code = is_3166_1.get(country, default_code)

# Default picked?
if country_code == default_code:
print("No country_code found for '%s'. Using '%s'!" % (country, country_code))

# Return.
return country_code
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
Global conftest file for shared pytest fixtures
"""
import pytest
from fastapi.testclient import TestClient

from app.main import APP
from fastapi.testclient import TestClient


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from unittest import mock

import pytest
from fastapi.testclient import TestClient

import app
from app import services
from app.main import APP
from fastapi.testclient import TestClient

from .test_jhu import DATETIME_STRING, mocked_requests_get, mocked_strptime_isoformat

Expand Down