Refactor/Enhance Tests Setup #146
YousefAldabbas
started this conversation in
Ideas
Replies: 1 comment
-
This would be great, @YousefAldabbas! You're more than welcome to tackle it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I'm planning to open an issue and close it. I want to know the community's/contributors' thoughts before proceeding.
The existing unit tests are relying on each other to pass the unit tests for example
test_update_user
relies ontest_post_user
success, Which violate unit tests best practices unit tests should be able to run in isolation src for example.Also
test_update_user
is calling another function which is relies on the server itself to generate token and then send it with the tests requests , it should be mocked.issue: usage of _get_token & environment variables to create user for testing
_get_token code
after implementing applying
and override function code (copied from one of my repos)
after that we can remove these env variable
we can also generate username and password for the admin using faker package
theres two new packages i will be adding:
in the end we will be able to tests all endpoints in isolation
Beta Was this translation helpful? Give feedback.
All reactions