from django.urls import reverse
from rest_framework.test import APITestCase
from rest_framework.authtoken.models import Token
from faker import Faker
fake = Faker()
APICLIENT = APIClient()
from factory_djoy import UserFactory
class TestAccount(APITestCase):
def setUp(self):
self.user = UserFactory()
def test_print_name(self):
print(self.user.is_authenticated)
# do something here
why print(self.user.is_authenticated) is True. I have tried to create a user using simply User.objects.create it also returns the same as is_authenticated to True.
My understanding is that it should be not be True before doing login or force_authenticate. What am I doing wrong or is my understanding not correct?