server/tests: fix failing tests
This commit is contained in:
parent
1231469a35
commit
0c05330cfc
|
@ -8,8 +8,11 @@ from szurubooru.func import auth, mailer
|
||||||
def inject_config(config_injector):
|
def inject_config(config_injector):
|
||||||
config_injector({
|
config_injector({
|
||||||
'secret': 'x',
|
'secret': 'x',
|
||||||
'base_url': 'http://example.com/',
|
'domain': 'http://example.com',
|
||||||
'name': 'Test instance',
|
'name': 'Test instance',
|
||||||
|
'smtp': {
|
||||||
|
'from': 'noreply@example.com',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +25,7 @@ def test_reset_sending_email(context_factory, user_factory):
|
||||||
assert api.password_reset_api.start_password_reset(
|
assert api.password_reset_api.start_password_reset(
|
||||||
context_factory(), {'user_name': initiating_user}) == {}
|
context_factory(), {'user_name': initiating_user}) == {}
|
||||||
mailer.send_mail.assert_called_once_with(
|
mailer.send_mail.assert_called_once_with(
|
||||||
'noreply@Test instance',
|
'noreply@example.com',
|
||||||
'user@example.com',
|
'user@example.com',
|
||||||
'Password reset for Test instance',
|
'Password reset for Test instance',
|
||||||
'You (or someone else) requested to reset your password ' +
|
'You (or someone else) requested to reset your password ' +
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import pytest
|
||||||
from szurubooru.func import image_hash
|
from szurubooru.func import image_hash
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,8 +8,16 @@ def test_hashing(read_asset, config_injector):
|
||||||
'host': 'localhost',
|
'host': 'localhost',
|
||||||
'port': 9200,
|
'port': 9200,
|
||||||
'index': 'szurubooru_test',
|
'index': 'szurubooru_test',
|
||||||
|
'user': 'szurubooru',
|
||||||
|
'pass': None,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if not image_hash.get_session().ping():
|
||||||
|
pytest.xfail(
|
||||||
|
'Unable to connect to ElasticSearch, '
|
||||||
|
'perhaps it is not available for this test?')
|
||||||
|
|
||||||
image_hash.purge()
|
image_hash.purge()
|
||||||
image_hash.add_image('test', read_asset('jpeg.jpg'))
|
image_hash.add_image('test', read_asset('jpeg.jpg'))
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ def test_update_post_source():
|
||||||
def test_update_post_source_with_too_long_string():
|
def test_update_post_source_with_too_long_string():
|
||||||
post = model.Post()
|
post = model.Post()
|
||||||
with pytest.raises(posts.InvalidPostSourceError):
|
with pytest.raises(posts.InvalidPostSourceError):
|
||||||
posts.update_post_source(post, 'x' * 1000)
|
posts.update_post_source(post, 'x' * 3000)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|
Loading…
Reference in New Issue