Adding test for actix-web#698
Conversation
|
Can you convert this to draft? |
|
@tyt2y3 No problem, good to know for the future. |
There was a problem hiding this comment.
Hey @dsullivan7, sorry for the delay and thanks for the contributions!!
Recently, we're updating the examples to include mock testing for SeaORM's CRUD operations. Please check the PR at #890.
Basically, we decouple SeaORM CRUD operations from the web API. Then, we mock test the CRUD operations. This avoid the pitfall that most web API requires the app state to be cloneable but SeaORM connection isn't cloneable when mock feature is enabled.
I think what you did is interesting and it's a good demonstration on testing the point of integration between Actix, SeaORM and Tera. And it fill the missing gap that we didn't cover in #890 - testing the handlers of web API.
|
@billy1624 Thanks very much for the response. I'm going to close this PR. Glad to see more development on this, it's a great library. |
|
Thanks again for contributing!! Let me know if you spot any room for improvements :) |
I'd like to add a test for actix-web, however, I found that the
into_transaction_logfunction can't be called on theMockDatabasebecauseAppState, more specificallyconn, has already been consumed. I'm looking for guidance on how to avoid this problem, let me know what I can do.