is a great library to integrate 3rd party logins into your web application. It supports multiple frameworks and multiple 3rd party logins. It is also great because if a 3rd party isn't supported, it is pretty easy to add a new one. Python Social Auth I recently built a custom integration and so I wanted to do some extra automated testing of the integration. Here is a quick way to test without having to mock HTTP calls or hit live external endpoints. #1 Create a Mock Backend I based my test off of Github so you may need to override more methods for other backends. Basically you need to override 2 methods. The first one overrides state validation so we can use made up tokens, and the second overrides fetching data about the user so we don't need to make external calls. social_core.backends.github GithubOAuth2 { : , : , : , : , : , : , : , } from import : class GithubFake (GithubOAuth2) : def validate_state (self) return 'good' : def get_json (self, url, *args, **kwargs) return "id" 12345 "login" "pizzapanther" "expires" None "auth_time" 1565736030 "token_type" "bearer" "access_token" "narf-token" "email" "narf@aol.com" #2 Write Your Test This code snippet will be a little less helpful because it uses some customized things in my project's pytest environment. But hopefully it will give you the gist of how you can test. Set mock backend. Test redirect to third party site. Simulate successful return and verify account is created and/or logged in. Note: that since we are using the mock backend, the code and state parameters can now be invalid. pytest requests GITHUB_CONFIG = { : [ ], : { : , : , } } response = requests.get( , allow_redirects= ) response.status_code == response.headers[ ].startswith( ) response = requests.get( , allow_redirects= ) response.status_code == response.headers response.headers[ ] import import 'backends' 'myapp.backends.github.GithubFake' 'settings' 'github_secret' 'super-long-secret' 'github_key' 'super-short-secret' @pytest.mark.app_config(config=GITHUB_CONFIG, key='auth_backends') : def test_psa_login_flow (base_url) # test login init f' /auth/login/github' {base_url} False assert 302 assert 'Location' 'https://github.com/login/oauth/authorize' # test login return f' /auth/complete/github?code=TEST&state=TEST' {base_url} False assert 302 assert 'Set-Cookie' in assert 'login_token=' in 'Set-Cookie' Have fun testing!