fn insert_in_nullable_with_non_null_default() {
    use crate::schema::users::table as users;
    use crate::schema_dsl::*;

    let connection = &mut connection();
    drop_table_cascade(connection, "users");
    create_table(
        "users",
        (
            integer("id").primary_key().auto_increment(),
            string("name").not_null(),
            string("hair_color").default("'Green'"),
        ),
    )
    .execute(connection)
    .unwrap();

    insert_into(users)
        .values(&DefaultColorUser::new("Wylla", None))
        .execute(connection)
        .unwrap();

    insert_into(users)
        .values(&DefaultColorUser::new("Tess", Some(None)))
        .execute(connection)
        .unwrap();

    let expected_users = vec![
        User {
            id: 1,
            name: "Wylla".to_string(),
            hair_color: Some("Green".to_string()),
        },
        User {
            id: 2,
            name: "Tess".to_string(),
            hair_color: None,
        },
    ];
    let actual_users = users.load(connection).unwrap();

    assert_eq!(expected_users, actual_users);
}
// FIXME: Figure out how to handle tests that modify schema
Figure out how to handle tests that modify schema
Figure out how to handle tests that modify schema
fn insert_in_nullable_with_non_null_default() {
    use crate::schema::users::table as users;
    use crate::schema_dsl::*;
    let connection = &mut connection();
    drop_table_cascade(connection, "users");
    create_table(
        "users",
        (
            integer("id").primary_key().auto_increment(),
            string("name").not_null(),
            string("hair_color").default("'Green'"),
        ),
    )
    .execute(connection)
    .unwrap();
    insert_into(users)
        .values(&DefaultColorUser::new("Wylla", None))
        .execute(connection)
        .unwrap();
    insert_into(users)
        .values(&DefaultColorUser::new("Tess", Some(None)))
        .execute(connection)
        .unwrap();
    let expected_users = vec![
        User {
            id: 1,
            name: "Wylla".to_string(),
            hair_color: Some("Green".to_string()),
        },
        User {
            id: 2,
            name: "Tess".to_string(),
            hair_color: None,
        },
    ];
    let actual_users = users.load(connection).unwrap();
    assert_eq!(expected_users, actual_users);
}
fn insert_in_nullable_with_non_null_default ( ) { use crate :: schema :: users :: table as users ; use crate :: schema_dsl :: * ; let connection = & mut connection ( ) ; drop_table_cascade ( connection , " " ) ; create_table ( " " , ( integer ( " " ) . primary_key ( ) . auto_increment ( ) , string ( " " ) . not_null ( ) , string ( " " ) . default ( " " ) , ) , ) . execute ( connection ) . unwrap ( ) ; insert_into ( users ) . values ( & DefaultColorUser :: new ( " " , None ) ) . execute ( connection ) . unwrap ( ) ; insert_into ( users ) . values ( & DefaultColorUser :: new ( " " , Some ( None ) ) ) . execute ( connection ) . unwrap ( ) ; let expected_users = vec ! [ User { id 1 name " " to_string ( ) hair_color Some ( " " to_string ( ) ) } User { id 2 name " " to_string ( ) hair_color None } ] ; let actual_users = users . load ( connection ) . unwrap ( ) ; assert_eq ! ( expected_users actual_users ) ; }
FIXME: Figure out how to handle tests that modify schema
FIXME : Figure out how to handle tests that modify schema