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):
 | 
			
		||||
    config_injector({
 | 
			
		||||
        'secret': 'x',
 | 
			
		||||
        'base_url': 'http://example.com/',
 | 
			
		||||
        'domain': 'http://example.com',
 | 
			
		||||
        '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(
 | 
			
		||||
                context_factory(), {'user_name': initiating_user}) == {}
 | 
			
		||||
            mailer.send_mail.assert_called_once_with(
 | 
			
		||||
                'noreply@Test instance',
 | 
			
		||||
                'noreply@example.com',
 | 
			
		||||
                'user@example.com',
 | 
			
		||||
                'Password reset for Test instance',
 | 
			
		||||
                'You (or someone else) requested to reset your password ' +
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
import pytest
 | 
			
		||||
from szurubooru.func import image_hash
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -7,8 +8,16 @@ def test_hashing(read_asset, config_injector):
 | 
			
		||||
            'host': 'localhost',
 | 
			
		||||
            'port': 9200,
 | 
			
		||||
            '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.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():
 | 
			
		||||
    post = model.Post()
 | 
			
		||||
    with pytest.raises(posts.InvalidPostSourceError):
 | 
			
		||||
        posts.update_post_source(post, 'x' * 1000)
 | 
			
		||||
        posts.update_post_source(post, 'x' * 3000)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.mark.parametrize(
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user