mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
mediawiki: Fix tests to allow running from any directory
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
cb15d34482
commit
e7181bb18a
@ -17,6 +17,7 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import pathlib
|
||||
import time
|
||||
|
||||
import requests
|
||||
@ -125,8 +126,9 @@ def upload_image_mediawiki(browser, username, password, image):
|
||||
|
||||
# Upload file
|
||||
browser.visit(config['DEFAULT']['url'] + '/mediawiki/Special:Upload')
|
||||
file_path = os.path.realpath('../static/themes/default/img/' + image)
|
||||
browser.attach_file('wpUploadFile', file_path)
|
||||
file_path = pathlib.Path(__file__).parent
|
||||
file_path /= '../../static/themes/default/img/' + image
|
||||
browser.attach_file('wpUploadFile', str(file_path.resolve()))
|
||||
interface.submit(browser, element=browser.find_by_name('wpUpload')[0])
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user