Use v2 endpoint to upload media
v1 is deprecated
This commit is contained in:
parent
7ed28b3bc3
commit
14a286ef0d
2 changed files with 3 additions and 3 deletions
|
@ -300,10 +300,10 @@ def test_upload(mock_post, capsys):
|
||||||
|
|
||||||
console.run_command(app, user, 'upload', [__file__])
|
console.run_command(app, user, 'upload', [__file__])
|
||||||
|
|
||||||
mock_post.call_count == 1
|
assert mock_post.call_count == 1
|
||||||
|
|
||||||
args, kwargs = http.post.call_args
|
args, kwargs = http.post.call_args
|
||||||
assert args == (app, user, '/api/v1/media')
|
assert args == (app, user, '/api/v2/media')
|
||||||
assert isinstance(kwargs['files']['file'], io.BufferedReader)
|
assert isinstance(kwargs['files']['file'], io.BufferedReader)
|
||||||
|
|
||||||
out, err = capsys.readouterr()
|
out, err = capsys.readouterr()
|
||||||
|
|
|
@ -348,7 +348,7 @@ def anon_tag_timeline_generator(instance, hashtag, local=False, limit=20):
|
||||||
|
|
||||||
|
|
||||||
def upload_media(app, user, file, description=None):
|
def upload_media(app, user, file, description=None):
|
||||||
return http.post(app, user, '/api/v1/media',
|
return http.post(app, user, '/api/v2/media',
|
||||||
data={'description': description},
|
data={'description': description},
|
||||||
files={'file': file}
|
files={'file': file}
|
||||||
).json()
|
).json()
|
||||||
|
|
Loading…
Reference in a new issue