source::password_reset_request::PasswordResetRequest_,
Crud,
};
- use lemmy_db_schema::source::{password_reset_request::PasswordResetRequest, person::*};
+ use lemmy_db_schema::source::{
+ local_user::{LocalUser, LocalUserForm},
+ password_reset_request::PasswordResetRequest,
+ person::*,
+ };
use serial_test::serial;
#[test]
let inserted_person = Person::create(&conn, &new_person).unwrap();
+ let new_local_user = LocalUserForm {
+ person_id: inserted_person.id,
+ password_encrypted: "pass".to_string(),
+ email: None,
+ matrix_user_id: None,
+ admin: None,
+ show_nsfw: None,
+ theme: None,
+ default_sort_type: None,
+ default_listing_type: None,
+ lang: None,
+ show_avatars: None,
+ send_notifications_to_email: None,
+ };
+
+ let inserted_local_user = LocalUser::create(&conn, &new_local_user).unwrap();
+
let token = "nope";
let token_encrypted_ = "ca3704aa0b06f5954c79ee837faa152d84d6b2d42838f0637a15eda8337dbdce";
let inserted_password_reset_request =
- PasswordResetRequest::create_token(&conn, inserted_person.id, token).unwrap();
+ PasswordResetRequest::create_token(&conn, inserted_local_user.id, token).unwrap();
let expected_password_reset_request = PasswordResetRequest {
id: inserted_password_reset_request.id,
- local_user_id: inserted_person.id,
+ local_user_id: inserted_local_user.id,
token_encrypted: token_encrypted_.to_string(),
published: inserted_password_reset_request.published,
};