from app.schemas import ContactCreate

def test_contact_create_valid():
    data = {
        "name": "Jean Dupont",
        "email": "jean@example.com",
        "subject": "Test",
        "message": "Hello"
    }
    contact = ContactCreate(**data)
    assert contact.name == "Jean Dupont"
    assert contact.email == "jean@example.com"

def test_contact_create_invalid_email():
    data = {
        "name": "Test",
        "email": "not-an-email",
        "subject": "Test",
        "message": "Hello"
    }
    try:
        ContactCreate(**data)
        assert False, "Should raise validation error"
    except Exception as e:
        assert "email" in str(e).lower()
