Fix tests

This commit is contained in:
Quat3rnion 2024-06-02 19:02:36 -04:00
parent ab4435a79f
commit 08952db014
2 changed files with 5 additions and 7 deletions

View File

@ -2,7 +2,6 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
use std::str::FromStr;
use chrono::DateTime; use chrono::DateTime;
use chorus::types::{LoginSchema, RegisterSchema}; use chorus::types::{LoginSchema, RegisterSchema};
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
@ -18,7 +17,7 @@ async fn test_registration() {
let mut bundle = common::setup().await; let mut bundle = common::setup().await;
let reg = RegisterSchema { let reg = RegisterSchema {
username: "Hiiii".into(), username: "Hiiii".into(),
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
consent: true, consent: true,
..Default::default() ..Default::default()
}; };
@ -34,7 +33,7 @@ async fn test_login() {
username: "Hiiii".into(), username: "Hiiii".into(),
email: Some("testuser1@integrationtesting.xyz".into()), email: Some("testuser1@integrationtesting.xyz".into()),
password: Some("Correct-Horse-Battery-Staple1".into()), password: Some("Correct-Horse-Battery-Staple1".into()),
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
consent: true, consent: true,
..Default::default() ..Default::default()
}; };
@ -56,7 +55,7 @@ async fn test_wrong_login() {
username: "Hiiii".into(), username: "Hiiii".into(),
email: Some("testuser2@integrationtesting.xyz".into()), email: Some("testuser2@integrationtesting.xyz".into()),
password: Some("Correct-Horse-Battery-Staple1".into()), password: Some("Correct-Horse-Battery-Staple1".into()),
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
consent: true, consent: true,
..Default::default() ..Default::default()
}; };

View File

@ -2,7 +2,6 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
use std::str::FromStr;
use chrono::DateTime; use chrono::DateTime;
use chorus::gateway::Gateway; use chorus::gateway::Gateway;
use chorus::types::IntoShared; use chorus::types::IntoShared;
@ -32,7 +31,7 @@ impl TestBundle {
let register_schema = RegisterSchema { let register_schema = RegisterSchema {
username: username.to_string(), username: username.to_string(),
consent: true, consent: true,
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
..Default::default() ..Default::default()
}; };
self.instance self.instance
@ -62,7 +61,7 @@ pub(crate) async fn setup() -> TestBundle {
let reg = RegisterSchema { let reg = RegisterSchema {
username: "integrationtestuser".into(), username: "integrationtestuser".into(),
consent: true, consent: true,
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
..Default::default() ..Default::default()
}; };
let guild_create_schema = GuildCreateSchema { let guild_create_schema = GuildCreateSchema {