mirror of
				https://github.com/fastapi-users/fastapi-users.git
				synced 2025-11-04 14:45:50 +08:00 
			
		
		
		
	* Fix #68: use makefun to generate dynamic dependencies * Remove every Starlette imports * Split every routers and remove event handlers * Make users router optional * Pass after_update handler to get_users_router * Update documentation * Remove test file * Write migration doc for splitted routers
		
			
				
	
	
		
			32 lines
		
	
	
		
			904 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			904 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import pytest
 | 
						|
from fastapi import Response
 | 
						|
 | 
						|
from fastapi_users.authentication import BaseAuthentication
 | 
						|
 | 
						|
 | 
						|
@pytest.fixture
 | 
						|
def base_authentication():
 | 
						|
    return BaseAuthentication()
 | 
						|
 | 
						|
 | 
						|
@pytest.mark.authentication
 | 
						|
class TestAuthenticate:
 | 
						|
    @pytest.mark.asyncio
 | 
						|
    async def test_not_implemented(self, base_authentication, mock_user_db):
 | 
						|
        with pytest.raises(NotImplementedError):
 | 
						|
            await base_authentication(None, mock_user_db)
 | 
						|
 | 
						|
 | 
						|
@pytest.mark.authentication
 | 
						|
@pytest.mark.asyncio
 | 
						|
async def test_get_login_response(base_authentication, user):
 | 
						|
    with pytest.raises(NotImplementedError):
 | 
						|
        await base_authentication.get_login_response(user, Response())
 | 
						|
 | 
						|
 | 
						|
@pytest.mark.authentication
 | 
						|
@pytest.mark.asyncio
 | 
						|
async def test_get_logout_response(base_authentication, user):
 | 
						|
    with pytest.raises(NotImplementedError):
 | 
						|
        await base_authentication.get_logout_response(user, Response())
 |