1
use super::*;
2
use crate::command::{CmdError, CmdResult, FinanceEntity};
3
use crate::user::User;
4
use crate::{
5
    command::{account::CreateAccount, commodity::CreateCommodity},
6
    db::install_test_pool,
7
};
8
use chrono::Duration;
9
use finance::tag::Tag;
10
use finance::{account::Account, price::Price, split::Split};
11
use sqlx::PgPool;
12
use sqlx::types::{
13
    Uuid,
14
    chrono::{DateTime, Utc},
15
};
16
use std::collections::HashMap;
17
use supp_macro::local_db_sqlx_test;
18
use tokio::sync::OnceCell;
19

            
20
/// Context for keeping environment intact
21
static CONTEXT: OnceCell<()> = OnceCell::const_new();
22
static USER: OnceCell<User> = OnceCell::const_new();
23

            
24
27
async fn setup() {
25
27
    CONTEXT
26
27
        .get_or_init(|| async {
27
27
            crate::telemetry::init_test_logging();
28
54
        })
29
27
        .await;
30
54
    USER.get_or_init(|| async { User { id: Uuid::new_v4() } })
31
27
        .await;
32
27
}
33

            
34
mod create;
35
mod cross_price;
36
mod delete;
37
mod pagination;
38
mod read;
39
mod replace_prices;
40
mod script_pool;
41
mod scripts;
42
mod update;
43
mod update_prices;