I am using pytest to test my django rest framework API and am gettin gan error on the following test: traceback in pytest is as follows: I dont ...
I am using pytest to test my django rest framework API and am gettin gan error on the following test: traceback in pytest is as follows: I dont ...
Is there a way to make instantiating instances from factories use Model.objects.create_user instead of Model.objects.create? It seems that user_factor ...
According to the documentation, --reuse-db should be used or addopts = --reuse-db in pytest.ini. I tried both and they don't work. The current tests h ...
I am writing unit tests for a function. In parameterize, I am generating tests cases by making some DB calls when required. def my_function(tokens): ...
I got a weird error when running pytest in a newly installed ubuntu 22. Google chrome was installed and running fine. However, when I run some tests i ...
I've a method inside a manager, this method calls a function imported from different module now I'm trying to write a test that make sure the function ...
Let's say I have the following pytest-django tests: There's a lot of duplication here. Would be great to use pytest's parametrize feature like belo ...
I am using pytest with pytest-django and pytest-bdd to test a simple django application. The settings file defines a test sqlite3 database, which is c ...
I'm doing a project in django and I have 2 serializer like this: parent_serializer.py child_serializer.py There is an if statement in the valida ...
I've got a number of unmanaged models that I'm trying to develop some factories for so I can get some tests put together. The issue is that on a coupl ...
I am currently testing my django model using pytest (and pytest-django), but I can not write a failing test case in which a required field is missing. ...
I'm new to testing and I spent a day finding a solution for my problem but I couldn't find any. this is my serializer serilaizer.py I have two typ ...
While i was trying to test my model, it was linked to a signals file where when.save() is called on that model, the signals file is triggered and then ...
The default db is cloud one. And when pytest tries to create a temporary data it got permissions error. So i want to create a second database to be us ...
In pytest-django there is a builtin fixture live_server though it seems like this server (that is actually based on LiveServerTestCase) can't handle w ...
I have an api in Django that uses quite a few environment variables. The idea is to add pytest-django to test all its functionalities (I know it would ...
I've got an endpoint that receives a form data, where one of the keys is an array of objects that contain an image. I'm trying to make the following ...
When django tests are running, database transactions are not committed. How do I test an event triggered by object creation but that happens after the ...
I am writing afew test cases using pytest for my django project. I have created an .ini file in the root directory as follow: and in the main direc ...
I am trying to run a simple django app on docker-compose I created a docker file and docker compose and when running I get the following. I had two v ...