✅ Fix backend tests failing if FIRST_SUPERUSER_PASSWORD is not "changethis"#1213
✅ Fix backend tests failing if FIRST_SUPERUSER_PASSWORD is not "changethis"#1213swelborn wants to merge 3 commits into
Conversation
|
Forgot to add... To reproduce:
|
|
Hi @alejsdev. Before I merge, there was another comment here on this: #1135 (comment) Should we consider this? I think the API functionality is still tested, but the commenter is right that the actual password change isn't really tested... I think one solution is caching original password, changing it, testing the change, and then resetting it back to the original. |
|
I see, I think it would be better to create a new user and use it to reset his password or using @swelborn approach because changing the password of the first superuser would break the other tests, and using the same password doesn't make much more sense, I think it would be better to refactor this test cc @tiangolo @estebanx64 🤔 |
|
Hey @javadzarezadeh and @alejsdev - I see that you both approved this. Could merge for now to avoid tests failing for new users, and then refactor a different way with a new issue? |
See discussion here: #1135 (reply in thread)
This was changed in the following PR: #632
Changing it back to
settings.FIRST_SUPERUSER_PASSWORDmakes it work again.I think the issue is that after this test, the password is changed to something else and the other tests can't authorize.
There was another fix in that discussion here: #1135 (reply in thread)
Don't know what is preferred, let me know.