forge
Explore
Log in

Don't you dare go Hollow

Re-point C2 cross-lane test calls after exam/exam_question merge

Browse files at this commit

4e8dec56b117d97d6413e2b9dda65c9077c07f0fAhmet Kaan GümüşParent: e0fb40e
  • chore
    • re-point C2 cross-lane test calls after exam/exam_question merge
Show full message
🧹 chore: re-point C2 cross-lane test calls after exam/exam_question merge
src/db/exam.rsmodified+7 -7
@@ -731,7 +731,7 @@ mod tests {
731 /// question claims a reference on its subject and is refused without one.731 /// question claims a reference on its subject and is refused without one.
732 async fn question_on(exam: &Exam, db: &Database) -> crate::domain::exam_question::ExamQuestion {732 async fn question_on(exam: &Exam, db: &Database) -> crate::domain::exam_question::ExamQuestion {
733 use crate::domain::exam_question::{733 use crate::domain::exam_question::{
734- ChoiceInput, ExamQuestion, QuestionKind, QuestionPoints, QuestionSpec, QuestionText,734+ ChoiceInput, QuestionKind, QuestionPoints, QuestionSpec, QuestionText,
735 };735 };
736 let spec = QuestionSpec::try_new(736 let spec = QuestionSpec::try_new(
737 QuestionKind::try_new("choice").unwrap(),737 QuestionKind::try_new("choice").unwrap(),
@@ -757,13 +757,13 @@ mod tests {
757 )757 )
758 .await758 .await
759 .unwrap();759 .unwrap();
760- ExamQuestion::create(760+ crate::db::exam_question::create(
761+ db,
761 exam.get_id(),762 exam.get_id(),
762 subject.get_id().clone(),763 subject.get_id().clone(),
763 QuestionText::try_new("3 + 3?").unwrap(),764 QuestionText::try_new("3 + 3?").unwrap(),
764 QuestionPoints::try_new(5).unwrap(),765 QuestionPoints::try_new(5).unwrap(),
765 spec,766 spec,
766- db,
767 )767 )
768 .await768 .await
769 .unwrap()769 .unwrap()
@@ -876,7 +876,7 @@ mod tests {
876 #[ignore = "needs a real SurrealDB server: podman start hezarfen-surrealdb && cargo test -- --ignored"]876 #[ignore = "needs a real SurrealDB server: podman start hezarfen-surrealdb && cargo test -- --ignored"]
877 async fn a_question_written_inside_a_delete_never_outlives_the_exam() {877 async fn a_question_written_inside_a_delete_never_outlives_the_exam() {
878 use crate::domain::exam_question::{878 use crate::domain::exam_question::{
879- ChoiceInput, ExamQuestion, QuestionKind, QuestionPoints, QuestionSpec, QuestionText,879+ ChoiceInput, QuestionKind, QuestionPoints, QuestionSpec, QuestionText,
880 };880 };
881 use crate::domain::subject::Subject;881 use crate::domain::subject::Subject;
882 let (db, _serialized) = crate::database::init_test_server("exam_question_race").await;882 let (db, _serialized) = crate::database::init_test_server("exam_question_race").await;
@@ -926,13 +926,13 @@ mod tests {
926 &[],926 &[],
927 )927 )
928 .unwrap();928 .unwrap();
929- ExamQuestion::create(929+ crate::db::exam_question::create(
930+ &db,
930 &exam_id,931 &exam_id,
931 on,932 on,
932 QuestionText::try_new("3 + 3?").unwrap(),933 QuestionText::try_new("3 + 3?").unwrap(),
933 QuestionPoints::try_new(5).unwrap(),934 QuestionPoints::try_new(5).unwrap(),
934 spec,935 spec,
935- &db,
936 )936 )
937 .await937 .await
938 })938 })
@@ -945,7 +945,7 @@ mod tests {
945 945
946 if read(&db, &id).await.unwrap().is_none() {946 if read(&db, &id).await.unwrap().is_none() {
947 swept += 1;947 swept += 1;
948- questions += ExamQuestion::list_for_exam(&id, None, 0, &db)948+ questions += crate::db::exam_question::list_for_exam(&db, &id, None, 0)
949 .await949 .await
950 .unwrap()950 .unwrap()
951 .0951 .0
src/db/exam_question.rsmodified+2 -2
@@ -412,7 +412,8 @@ mod tests {
412 412
413 async fn an_exam(db: &Database) -> Exam {413 async fn an_exam(db: &Database) -> Exam {
414 let kinds = Settings::defaults().get_exam_kinds().to_vec();414 let kinds = Settings::defaults().get_exam_kinds().to_vec();
415- Exam::create(415+ crate::db::exam::create(
416+ db,
416 &UserId::from_key("01TESTTEACHERAAAAAAAAAAAAA"),417 &UserId::from_key("01TESTTEACHERAAAAAAAAAAAAA"),
417 &crate::db::course::a_test_course(db).await,418 &crate::db::course::a_test_course(db).await,
418 ExamTitle::try_new("practice").unwrap(),419 ExamTitle::try_new("practice").unwrap(),
@@ -424,7 +425,6 @@ mod tests {
424 true,425 true,
425 false,426 false,
426 false,427 false,
427- db,
428 )428 )
429 .await429 .await
430 .unwrap()430 .unwrap()