mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-27 12:30:31 +00:00
Cache fetched instance
This commit is contained in:
parent
8b00853e88
commit
dbf36ddf05
1 changed files with 4 additions and 2 deletions
|
@ -422,7 +422,7 @@ mod tests {
|
|||
fn create_models(conn: &DbConn) -> (Instance, User, Blog, Post) {
|
||||
conn.transaction::<(Instance, User, Blog, Post), diesel::result::Error, _>(|| {
|
||||
let instance = Instance::get_local().unwrap_or_else(|_| {
|
||||
Instance::insert(
|
||||
let instance = Instance::insert(
|
||||
conn,
|
||||
NewInstance {
|
||||
default_license: "CC-0-BY-SA".to_string(),
|
||||
|
@ -436,7 +436,9 @@ mod tests {
|
|||
public_domain: random_hex().to_string(),
|
||||
},
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
Instance::cache_local(conn);
|
||||
instance
|
||||
});
|
||||
let mut user = NewUser::default();
|
||||
user.instance_id = instance.id;
|
||||
|
|
Loading…
Reference in a new issue