Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@darkmmon
Copy link
Contributor

PR Info

  • Closes
  • Dependencies:
  • Dependents:

New Features

Bug Fixes

Breaking Changes

Changes

  • add comprehensive test cases to most of the APIs

@tyt2y3
Copy link
Member

tyt2y3 commented Aug 15, 2023

As discussed, the most needed test cases are for:

  1. find_with_related()
  2. find_with_linked()

And we needed both unit testing e.g. https://github.com/SeaQL/sea-orm/blob/master/src/executor/paginator.rs#L299 https://github.com/SeaQL/sea-orm/blob/master/src/executor/cursor.rs#L308 and integration testing (which you are doing) to test the behaviour of consolidate_query_result.

}

#[smol_potat::test]
pub async fn with_related() -> Result<(), sea_orm::DbErr> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add 1 more case: Cake -> Filling

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see new test cases for Cake -> Vendor but not Cake -> Filling?

@darkmmon darkmmon marked this pull request as ready for review August 18, 2023 11:03
Comment on lines +1327 to +1328
cake_fruit_model(1, 1).into_mock_row(),
cake_fruit_model(2, 1).into_mock_row(),
Copy link
Member

@tyt2y3 tyt2y3 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can't duplicate right? This should be for Filling?

.into_connection();

assert_eq!(
Cake::find().find_with_related(Fruit).all(&db).await?,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, may be change this to Filling

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make the changes.

@tyt2y3 tyt2y3 merged commit d50312c into SeaQL:master Aug 18, 2023
@github-actions
Copy link

🎉 Released In 0.12.3 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants