chore: 优化本地开发环境配置
- 添加 .env.local 支持,app.sh 和 dev-migrate.sh 自动覆盖 - Docker Compose 使用 profiles 区分 dev/prod 环境 - 改进认证 dev session 判断逻辑,使用 test account 配置 - 修复 CoinPackageCard 重复代码问题 - 清理 opencode 配置,移除敏感信息 - 新增 infra/docker/README.md 文档 - 修复 ruff/pyright/flutter lint 错误 - 更新测试用例移除已删除的 country 字段
This commit is contained in:
@@ -17,7 +17,6 @@ class TestParseProfileSettings:
|
||||
"preferences": {
|
||||
"language": "en-US",
|
||||
"timezone": "America/New_York",
|
||||
"country": "US",
|
||||
},
|
||||
"privacy": {"profile_visibility": "private"},
|
||||
"notification": {
|
||||
@@ -32,7 +31,6 @@ class TestParseProfileSettings:
|
||||
assert isinstance(result.preferences, PreferenceSettings)
|
||||
assert result.preferences.language == "en-US"
|
||||
assert result.preferences.timezone == "America/New_York"
|
||||
assert result.preferences.country == "US"
|
||||
assert isinstance(result.notification, NotificationSettings)
|
||||
assert result.notification.allow_notifications is True
|
||||
assert result.notification.allow_vibration is False
|
||||
@@ -45,7 +43,6 @@ class TestParseProfileSettings:
|
||||
assert isinstance(result.preferences, PreferenceSettings)
|
||||
assert result.preferences.language == "zh-CN"
|
||||
assert result.preferences.timezone == "Asia/Shanghai"
|
||||
assert result.preferences.country == "US"
|
||||
assert isinstance(result.notification, NotificationSettings)
|
||||
assert result.notification.allow_notifications is True
|
||||
assert result.notification.allow_vibration is True
|
||||
@@ -60,7 +57,6 @@ class TestParseProfileSettings:
|
||||
|
||||
assert result.preferences.language == "en-US"
|
||||
assert result.preferences.timezone == "Asia/Shanghai"
|
||||
assert result.preferences.country == "US"
|
||||
|
||||
def test_parse_profile_settings_with_partial_notification(self) -> None:
|
||||
raw = {
|
||||
@@ -104,21 +100,11 @@ class TestParseProfileSettings:
|
||||
with pytest.raises(ValueError, match="timezone must be a valid IANA timezone"):
|
||||
parse_profile_settings(raw)
|
||||
|
||||
def test_parse_profile_settings_country_normalized_to_uppercase(self) -> None:
|
||||
raw = {
|
||||
"preferences": {
|
||||
"country": "us",
|
||||
},
|
||||
}
|
||||
result = parse_profile_settings(raw)
|
||||
assert result.preferences.country == "US"
|
||||
|
||||
def test_profile_settings_v1_model_dump(self) -> None:
|
||||
settings = ProfileSettingsV1(
|
||||
preferences=PreferenceSettings(
|
||||
language="en-US",
|
||||
timezone="UTC",
|
||||
country="US",
|
||||
),
|
||||
notification=NotificationSettings(
|
||||
allow_notifications=True,
|
||||
|
||||
Reference in New Issue
Block a user