[Answer]-Django Test Client does not create a user object but creates a anonymous user object

1👍

You are creating a new user, but you are not authenticating as that user. Therefor, the user you read from response.context is the AnonymousUser.

If you actually want to log in the user upon creation, the best way is probably to create your own form view.

Otherwise you have to change your test to read the newly created user from the database.

Leave a comment