Top "Django-tests" questions

Use for questions about testing applications based upon the Python web framework Django, or the features provided in the module itself (django.

What is actually assertEquals in Python?

I have the following test.py file in django. can you please explain this code? from contacts.models import Contact ... …

python django django-tests
How to run all tests with python manage.py test command in django

I am working on a django project in which I have multiple apps. Every app has a tests directory which …

python django unit-testing django-tests
how to perform a django test with a request.post?

ive got a view method i would love to test. i am supplying the self.client.get method with the …

python django django-tests
django update_or_create gets "duplicate key value violates unique constraint "

Maybe I misunderstand the purpose of Django's update_or_create Model method. Here is my Model: from django.db import …

django django-models django-tests
How to avoid creating test database for testing in django?

I have written some test cases for my project when I run these test cases, it creates test database for …

django django-tests
Python, MongoDB, Mongoengine - TypeError: string indices must be integers, not str

I am building a Django app that downloads some data via the LinkedIn api and stores it to MongoDB. I …

python django mongodb mongoengine django-tests
Mock a model method in Django

I'm just getting started with Mock for testing Django apps without touching the db. I can successfully mock my model …

django unit-testing django-models django-testing django-tests
Assert that two lists of objects are equal in django testing

Is there a way to check that two lists of objects are equal in django tests. lets say I have …

django django-testing django-tests
When I run test cases I get this error: psycopg2.OperationalError: cursor "_django_curs_140351416325888_23" does not exist

I'm trying to run test cases, but I get below error. Run command : python manage.py test Type 'yes' if …

python django postgresql django-tests
how to test a model that has a foreign key in django?

I'm using python 3.5 and Django 1.10 and trying to test my app in tests.py, but an error appeared, it said: …

django django-tests