kopia lustrzana https://github.com/halcy/Mastodon.py
Added missing verified_at attribute when updating profile fields.
rodzic
9225072cc8
commit
4e743e7f9e
|
@ -427,10 +427,10 @@ class Mastodon(Internals):
|
|||
raise MastodonIllegalArgumentError(
|
||||
'A maximum of four fields are allowed.')
|
||||
|
||||
fields_attributes = []
|
||||
for idx, (field_name, field_value) in enumerate(fields):
|
||||
for idx, (field_name, field_value, field_verified_at) in enumerate(fields):
|
||||
params_initial[f'fields_attributes[{idx}][name]'] = field_name
|
||||
params_initial[f'fields_attributes[{idx}][value]'] = field_value
|
||||
params_initial[f'fields_attributes[{idx}][verified_at]'] = field_verified_at
|
||||
|
||||
# Clean up params
|
||||
for param in ["avatar", "avatar_mime_type", "header", "header_mime_type", "fields"]:
|
||||
|
|
|
@ -119,8 +119,8 @@ def test_account_update_credentials(api):
|
|||
header = image,
|
||||
header_mime_type = "image/jpeg",
|
||||
fields = [
|
||||
("bread", "toasty."),
|
||||
("lasagna", "no!!!"),
|
||||
("bread", "toasty.", None),
|
||||
("lasagna", "no!!!", None),
|
||||
]
|
||||
)
|
||||
|
||||
|
@ -136,11 +136,11 @@ def test_account_update_credentials(api):
|
|||
def test_account_update_credentials_too_many_fields(api):
|
||||
with pytest.raises(MastodonIllegalArgumentError):
|
||||
api.account_update_credentials(fields = [
|
||||
('a', 'b'),
|
||||
('c', 'd'),
|
||||
('e', 'f'),
|
||||
('g', 'h'),
|
||||
('i', 'j'),
|
||||
('a', 'b', 'c'),
|
||||
('d', 'e', 'f'),
|
||||
('g', 'h', 'i'),
|
||||
('j', 'k', 'l'),
|
||||
('m', 'n', 'o'),
|
||||
])
|
||||
|
||||
@pytest.mark.vcr(match_on=['path'])
|
||||
|
|
Ładowanie…
Reference in New Issue