summaryrefslogtreecommitdiffstats
path: root/rust/tests/helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/tests/helpers.rs')
-rw-r--r--rust/tests/helpers.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/tests/helpers.rs b/rust/tests/helpers.rs
index 2410aa32..fda5852f 100644
--- a/rust/tests/helpers.rs
+++ b/rust/tests/helpers.rs
@@ -1,7 +1,9 @@
use fatcat::auth::MacaroonAuthMiddleware;
+use fatcat::editing_crud::EditgroupCrud;
use fatcat::identifiers::FatcatId;
use fatcat::server;
use fatcat_api_spec::client::Client;
+use fatcat_api_spec::models::Editgroup;
use fatcat_api_spec::Context;
use iron::headers::{Authorization, Bearer, ContentType};
use iron::mime::Mime;
@@ -91,3 +93,19 @@ pub fn check_http_response(
assert!(body.contains(thing));
}
}
+
+pub fn quick_editgroup(conn: &server::DbConn) -> FatcatId {
+ let editor_id = FatcatId::from_str(TEST_ADMIN_EDITOR_ID).unwrap();
+ let eg = Editgroup {
+ editgroup_id: None,
+ editor_id: Some(editor_id.to_string()),
+ editor: None,
+ submitted: None,
+ description: None,
+ extra: None,
+ annotations: None,
+ edits: None,
+ };
+ let row = eg.db_create(conn, false).unwrap();
+ FatcatId::from_uuid(&row.id)
+}