mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 07:31:12 +01:00
set default alias suffix to word (#1765)
Co-authored-by: Son NK <son@Sons-MacBook-Air-2.local>
This commit is contained in:
parent
d3aae31d45
commit
501c625ddf
2 changed files with 7 additions and 5 deletions
|
@ -445,7 +445,7 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle):
|
|||
random_alias_suffix = sa.Column(
|
||||
sa.Integer,
|
||||
nullable=False,
|
||||
default=AliasSuffixEnum.random_string.value,
|
||||
default=AliasSuffixEnum.word.value,
|
||||
server_default=str(AliasSuffixEnum.random_string.value),
|
||||
)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ def test_get_setting(flask_client):
|
|||
"notification": True,
|
||||
"random_alias_default_domain": "sl.local",
|
||||
"sender_format": "AT",
|
||||
"random_alias_suffix": "random_string",
|
||||
"random_alias_suffix": "word",
|
||||
}
|
||||
|
||||
|
||||
|
@ -95,11 +95,13 @@ def test_get_setting_domains_v2(flask_client):
|
|||
def test_update_settings_random_alias_suffix(flask_client):
|
||||
user = login(flask_client)
|
||||
# default random_alias_suffix is random_string
|
||||
assert user.random_alias_suffix == AliasSuffixEnum.random_string.value
|
||||
assert user.random_alias_suffix == AliasSuffixEnum.word.value
|
||||
|
||||
r = flask_client.patch("/api/setting", json={"random_alias_suffix": "invalid"})
|
||||
assert r.status_code == 400
|
||||
|
||||
r = flask_client.patch("/api/setting", json={"random_alias_suffix": "word"})
|
||||
r = flask_client.patch(
|
||||
"/api/setting", json={"random_alias_suffix": "random_string"}
|
||||
)
|
||||
assert r.status_code == 200
|
||||
assert user.random_alias_suffix == AliasSuffixEnum.word.value
|
||||
assert user.random_alias_suffix == AliasSuffixEnum.random_string.value
|
||||
|
|
Loading…
Reference in a new issue