APIClient giving Model.user must be a "User" instance when trying to test a view #8344
Unanswered
Massakera
asked this question in
Question & Answer
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I've been trying to write a test using the following code with APIClient for the cardgame that I've built:
This is the data that I need to send to test my POST mehod:
but i'm getting the following error and I don't know how to solve:
ValueError: Cannot assign "<django.contrib.auth.models.AnonymousUser object at 0x7fba0ef645b0>": "PokerRoom.user" must be a "User" instance.
Can someone help me?
Beta Was this translation helpful? Give feedback.
All reactions