def test_session_parse_with_session_with_identity(): backend = SessionBackend() request = Request() request.session = {"identity": "test"} assert backend.parse(request) == "test"
def test_session_parse_with_session_without_identity(): backend = SessionBackend() request = Request() request.session = {} assert backend.parse(request) is None