Merge branch 'fix-415-errors' into 'master'

Fix the 415 errors due to a change in Werkzeug

See merge request openlp/openlp!615
This commit is contained in:
Tim Bentley 2023-05-19 06:49:24 +00:00
commit a66153b6bb
4 changed files with 10 additions and 10 deletions

View File

@ -1 +1 @@
3.0.2.dev21+f22eafbeb
3.0.3.dev75+gf40ffd377

View File

@ -18,10 +18,10 @@
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
from pathlib import Path
from unittest.mock import MagicMock, patch
from openlp.core.common.registry import Registry
from pathlib import Path
def test_retrieve_live_items(flask_client, settings):
@ -56,14 +56,14 @@ def test_controller_set_does_not_accept_get(flask_client):
def test_controller_set_aborts_on_unspecified_controller(flask_client, settings):
res = flask_client.post('/api/v2/controller/show')
res = flask_client.post('/api/v2/controller/show', json={})
assert res.status_code == 400
def test_controller_set_calls_live_controller(flask_client, settings):
fake_live_controller = MagicMock()
Registry().register('live_controller', fake_live_controller)
res = flask_client.post('/api/v2/controller/show', json=dict(id=400))
res = flask_client.post('/api/v2/controller/show', json={'id': 400})
assert res.status_code == 204
fake_live_controller.slidecontroller_live_set.emit.assert_called_once_with([400])
@ -81,12 +81,12 @@ def test_controller_direction_does_not_accept_get(flask_client):
def test_controller_direction_does_fails_on_wrong_data(flask_client, settings):
res = flask_client.post('/api/v2/controller/progress', json=dict(action='foo'))
res = flask_client.post('/api/v2/controller/progress', json={'action': 'foo'})
assert res.status_code == 400
def test_controller_direction_does_fails_on_missing_data(flask_client, settings):
res = flask_client.post('/api/v2/controller/progress')
res = flask_client.post('/api/v2/controller/progress', json={})
assert res.status_code == 400
@ -118,7 +118,7 @@ def test_controller_get_theme_level_returns_valid_theme_level_song(flask_client,
def test_controller_set_theme_level_aborts_if_no_theme_level(flask_client, settings):
res = flask_client.post('/api/v2/controller/theme-level')
res = flask_client.post('/api/v2/controller/theme-level', json={})
assert res.status_code == 400
@ -237,7 +237,7 @@ def test_controller_get_theme_returns_current_theme_service(flask_client, settin
def test_controller_set_theme_aborts_if_no_theme(flask_client, settings):
res = flask_client.post('/api/v2/controller/theme')
res = flask_client.post('/api/v2/controller/theme', json={})
assert res.status_code == 400

View File

@ -93,7 +93,7 @@ def test_login_get_is_refused(flask_client):
def test_login_without_data_returns_400(flask_client):
res = flask_client.post('/api/v2/core/login')
res = flask_client.post('/api/v2/core/login', json={})
assert res.status_code == 400

View File

@ -73,7 +73,7 @@ def test_bibles_set_search_options_sets_bible_version(flask_client, settings):
def test_plugin_set_search_option_aborts_if_no_option(flask_client, settings):
Registry().register('plugin_manager', MagicMock())
res = flask_client.post('/api/v2/plugins/songs/search-options')
res = flask_client.post('/api/v2/plugins/songs/search-options', json={})
assert res.status_code == 400