Skip to content

Commit 4afa75d

Browse files
committed
Remove wrong test case
1 parent 1a21ae2 commit 4afa75d

File tree

2 files changed

+2
-57
lines changed

2 files changed

+2
-57
lines changed

src/query/join.rs

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -483,25 +483,7 @@ mod tests {
483483

484484
#[test]
485485
fn join_16() {
486-
let cake_model = cake::Model {
487-
id: 18,
488-
name: "".to_owned(),
489-
};
490-
assert_eq!(
491-
cake_model
492-
.find_linked(entity_linked::JoinWithoutReverse)
493-
.build(DbBackend::MySql)
494-
.to_string(),
495-
[
496-
r#"SELECT `vendor`.`id`, `vendor`.`name`"#,
497-
r#"FROM `vendor`"#,
498-
r#"INNER JOIN `filling` AS `r0` ON `r0`.`vendor_id` = `vendor`.`id`"#,
499-
r#"INNER JOIN `cake_filling` AS `r1` ON `r1`.`filling_id` = `r0`.`id`"#,
500-
r#"INNER JOIN `cake_filling` AS `r2` ON `r2`.`cake_id` = `r1`.`id` AND `r2`.`name` LIKE '%cheese%'"#,
501-
r#"WHERE `r2`.`id` = 18"#,
502-
]
503-
.join(" ")
504-
);
486+
// removed wrong test case
505487
}
506488

507489
#[test]
@@ -525,21 +507,7 @@ mod tests {
525507

526508
#[test]
527509
fn join_18() {
528-
assert_eq!(
529-
cake::Entity::find()
530-
.find_also_linked(entity_linked::JoinWithoutReverse)
531-
.build(DbBackend::MySql)
532-
.to_string(),
533-
[
534-
r#"SELECT `cake`.`id` AS `A_id`, `cake`.`name` AS `A_name`,"#,
535-
r#"`r2`.`id` AS `B_id`, `r2`.`name` AS `B_name`"#,
536-
r#"FROM `cake`"#,
537-
r#"LEFT JOIN `cake` AS `r0` ON `cake_filling`.`cake_id` = `r0`.`id` AND `cake_filling`.`name` LIKE '%cheese%'"#,
538-
r#"LEFT JOIN `filling` AS `r1` ON `r0`.`filling_id` = `r1`.`id`"#,
539-
r#"LEFT JOIN `vendor` AS `r2` ON `r1`.`vendor_id` = `r2`.`id`"#,
540-
]
541-
.join(" ")
542-
);
510+
// removed wrong test case
543511
}
544512

545513
#[test]

src/tests_cfg/entity_linked.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,6 @@ impl Linked for CheeseCakeToFillingVendor {
5858
}
5959
}
6060

61-
#[derive(Debug)]
62-
pub struct JoinWithoutReverse;
63-
64-
impl Linked for JoinWithoutReverse {
65-
type FromEntity = super::cake::Entity;
66-
67-
type ToEntity = super::vendor::Entity;
68-
69-
fn link(&self) -> Vec<RelationDef> {
70-
vec![
71-
super::cake_filling::Relation::Cake
72-
.def()
73-
.on_condition(|left, _right| {
74-
Expr::col((left, super::cake::Column::Name))
75-
.like("%cheese%")
76-
.into_condition()
77-
}),
78-
super::cake_filling::Relation::Filling.def(),
79-
super::filling::Relation::Vendor.def(),
80-
]
81-
}
82-
}
83-
8461
#[derive(Debug)]
8562
pub struct CakeToCakeViaFilling;
8663

0 commit comments

Comments
 (0)