mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2025-03-28 14:05:28 +00:00
Add methods to clear data of instances and users table for testing
This commit is contained in:
parent
31418b1079
commit
1d042e1bb2
2 changed files with 8 additions and 0 deletions
|
@ -306,6 +306,10 @@ pub(crate) mod tests {
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn clear_instances(conn: &Conn) {
|
||||||
|
diesel::delete(crate::schema::instances::table).execute(conn).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn local_instance() {
|
fn local_instance() {
|
||||||
let conn = &db();
|
let conn = &db();
|
||||||
|
|
|
@ -1171,6 +1171,10 @@ pub(crate) mod tests {
|
||||||
vec![admin, user, other]
|
vec![admin, user, other]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn clear_users(conn: &Conn) {
|
||||||
|
diesel::delete(crate::schema::users::table).execute(conn).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn find_by() {
|
fn find_by() {
|
||||||
let r = rockets();
|
let r = rockets();
|
||||||
|
|
Loading…
Reference in a new issue