Test fix
This commit is contained in:
+1
-5
@@ -7,7 +7,6 @@ mod db_mgr {
|
||||
|
||||
pub async fn get_pool() -> Result<sqlx::PgPool, sqlx::Error> {
|
||||
let tm_db_url = textsender_models::envy::environment::get_db_url()
|
||||
.await
|
||||
.value;
|
||||
let tm_options = sqlx::postgres::PgConnectOptions::from_str(&tm_db_url).unwrap();
|
||||
sqlx::PgPool::connect_with(tm_options).await
|
||||
@@ -21,7 +20,6 @@ mod db_mgr {
|
||||
|
||||
pub async fn connect_to_db(db_name: &str) -> Result<sqlx::PgPool, sqlx::Error> {
|
||||
let db_url = textsender_models::envy::environment::get_db_url()
|
||||
.await
|
||||
.value;
|
||||
let options = sqlx::postgres::PgConnectOptions::from_str(&db_url)?.database(db_name);
|
||||
sqlx::PgPool::connect_with(options).await
|
||||
@@ -82,7 +80,6 @@ mod db_mgr {
|
||||
|
||||
pub async fn get_database_name() -> Result<String, Box<dyn std::error::Error>> {
|
||||
let database_url = textsender_models::envy::environment::get_db_url()
|
||||
.await
|
||||
.value;
|
||||
let parsed_url = url::Url::parse(&database_url)?;
|
||||
|
||||
@@ -192,7 +189,6 @@ pub fn test_mer_response() -> serde_json::Value {
|
||||
|
||||
pub async fn test_token() -> Result<String, josekit::JoseError> {
|
||||
let key: String = textsender_models::envy::environment::get_secret_main_key()
|
||||
.await
|
||||
.value;
|
||||
let (message, issuer, audience) = token_fields();
|
||||
|
||||
@@ -203,7 +199,7 @@ pub async fn test_token() -> Result<String, josekit::JoseError> {
|
||||
user_id: TEST_USER_ID,
|
||||
};
|
||||
|
||||
match textsender_models::token::create_token(&key, &token_resource, time::Duration::hours(1)) {
|
||||
match textsender_models::token::create_token(&key, token_resource, time::Duration::hours(1)) {
|
||||
Ok(access_token) => Ok(access_token.access_token),
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user