Category "django-tests"

Why did the Django model return an empty queryset in the thread pool?

I used ThreadPoolExecutor in my API. in the test case, I generated a Movie instance and saved it in the database (PostgreSQL). I printed movie count in the test

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 models import datetime from vc.models imp

Django: Keeping setUpTestData DRY

I've been really enjoying the convenience of setUpTestData and --keepdb in Django 1.8! However, I am running into an issue keeping data consistent across multi

How to test a Django form with a ModelChoiceField using test client and post method

How do I use Django test client.post to test a form that has a ModelChoiceField? How should the data dictionary passed to the post method be written? The way I