def test_user_login_with_email():
    """Can a registered user can login with an email address instead of a team name"""
    app = create_ctfd()
    with app.app_context():
        register_user(app)
        client = login_as_user(app, name="user@examplectf.com", password="password")
        r = client.get("/profile")
        assert (
            r.location != "http://localhost/login"
        )  # We didn't get redirected to login
        assert r.status_code == 200
    destroy_ctfd(app)
Can a registered user can login with an email address instead of a team name
tests/users/test_auth.py