Use str.to_owned() in tests.