Category "django-testing"

While testing my Websocket Consumer a model object is not created (Django Channels)

I'm new in Django Channels and I'm trying to build a simple chat app. But when I'm trying to test my async Websocket Consumer I run into the following exception

django testing class based view

I have a Class based view defined as: class Myview(LoginRequiredMixin, View): def post(): #....... to test this view i tried this class MyViewTes

Unit Testing Django Model Save Function

I'm creating tests to check that a custom calibration model save function updates an asset record (foreign key) if it is the latest calibration record for the a

Inherinting Django SetUpTestData method called for each child

Inheriting a mother class make its classmethod setUpTestData called for each child class. This is what I excepted but not what I want. Here is a minimalist exam

Inherinting Django SetUpTestData method called for each child

Inheriting a mother class make its classmethod setUpTestData called for each child class. This is what I excepted but not what I want. Here is a minimalist exam

How to use StaticLiveServerTestCase with different domains?

I am using selenium for functional tests with geckodriver and firefox. I see the host is http://localhost:62305 and this is generated in that class with: @cla

When testing Django REST Framework, why can't I get APIClient.credentials() to authenticate using a token?

I'm writing a functional (not unit) test against a basic API, like so: from decouple import config from rest_framework.test import APIClient, APITestCase clas

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

django test app error - Got an error creating the test database: permission denied to create database

When I try to test any app with command (I noticed it when I tried to deploy myproject using fabric, which uses this command): python manage.py test appname

Django Testing - SimpleCookie and Session

Problem: My testing client appears to log out once i attempt to set a cookie. I have workspace (project) object that i want my client to access. The access itse

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