def METHOD_NAME(self):
    """Test a user logging in with a token."""
    request = testing.DummyRequest(
        path="/oidc/login-with-token",
        headers={"Authorization": "Bearer TOKEN"}
    )
    request.registry = self.registry
    request.db = self.db
    with mock.patch('requests.sessions.Session.send', side_effect=fake_send()):
        response = login_with_token(request)
    assert response.status_code == 202
    user = models.User.get('testuser')
    assert user.email == "testuser@example.com"
    assert [g.name for g in user.groups] == ["testgroup1", "testgroup2"]