python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Login, Register and Logout test failed AssertionError: 200 != 302 django
I am trying to create a test for my login, logout and register views but I keep on getting this error AssertionError: 200 != 302. Here are the codes:
MODEL
Here is the User model
from django.db import...

chryzcode
Votes: 0
Answers: 1
Instance error Django Test models.py AttributeError: 'NoneType' object has no attribute
I am performing a Django test case for models.py file the models.py file looks like
import sys
from datetime import datetime
from dateutil.relativedelta import relativedelta
from django.apps import a...
Adarsh Srivastav
Votes: 0
Answers: 0
Url not parsed when testing a ModelViewSet
I am trying to test a Django Rest Framework view. When I call my endpoint from a real api client, pk is correctly set. When it is called from the test, pk is None.
class ResourceViewSet(ModelViewSet):...
poiuytrez
Votes: 0
Answers: 1
Why user autometically authenticated in django test case?
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 facto...
Anand Renjre
Votes: 0
Answers: 1