def METHOD_NAME(client, source_filename, target_filename, wikitext, comment):
    mediawiki_api_url=get_mediawiki_url() + "/w/api.php"
    csrf_token=get_csrf_token(client)
    upload_payload={
        'action': 'upload',
        'format':'json',
        'filename':source_filename,
        'comment':comment,
        'text':wikitext,
        'ignorewarnings': 1,
        'token':csrf_token,
    }
    files={'file': (target_filename, open(source_filename,'rb'),'multipart/form-data')}
    r = client.post(mediawiki_api_url, data=upload_payload, files=files)
    return r