diff --git a/tests/auth.rs b/tests/auth.rs index 35007f1..6266aa3 100644 --- a/tests/auth.rs +++ b/tests/auth.rs @@ -2,6 +2,8 @@ // 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/. +use std::str::FromStr; +use chrono::DateTime; use chorus::types::{LoginSchema, RegisterSchema}; #[cfg(target_arch = "wasm32")] use wasm_bindgen_test::*; @@ -16,7 +18,7 @@ async fn test_registration() { let mut bundle = common::setup().await; let reg = RegisterSchema { username: "Hiiii".into(), - date_of_birth: Some("2000-01-01".to_string()), + date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), consent: true, ..Default::default() }; @@ -32,7 +34,7 @@ async fn test_login() { username: "Hiiii".into(), email: Some("testuser1@integrationtesting.xyz".into()), password: Some("Correct-Horse-Battery-Staple1".into()), - date_of_birth: Some("2000-01-01".to_string()), + date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), consent: true, ..Default::default() }; @@ -54,7 +56,7 @@ async fn test_wrong_login() { username: "Hiiii".into(), email: Some("testuser2@integrationtesting.xyz".into()), password: Some("Correct-Horse-Battery-Staple1".into()), - date_of_birth: Some("2000-01-01".to_string()), + date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), consent: true, ..Default::default() }; diff --git a/tests/common/mod.rs b/tests/common/mod.rs index a98667c..4abedd5 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -2,6 +2,8 @@ // 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/. +use std::str::FromStr; +use chrono::DateTime; use chorus::gateway::Gateway; use chorus::types::IntoShared; use chorus::{ @@ -30,7 +32,7 @@ impl TestBundle { let register_schema = RegisterSchema { username: username.to_string(), consent: true, - date_of_birth: Some("2000-01-01".to_string()), + date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), ..Default::default() }; self.instance @@ -60,7 +62,7 @@ pub(crate) async fn setup() -> TestBundle { let reg = RegisterSchema { username: "integrationtestuser".into(), consent: true, - date_of_birth: Some("2000-01-01".to_string()), + date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()), ..Default::default() }; let guild_create_schema = GuildCreateSchema {