DEV Community

Jaweher Ben Salah
Jaweher Ben Salah

Posted on

Why object is not being created while running Django TestCase

I created a simple model test case using TestCase class. I created an object using setUp function and test the count of the object using assertEqual inside another function.

The test ran successfully, but when I check the Django admin, there was no object that I just created, and also…

</p>
Enter fullscreen mode Exit fullscreen mode





https://docs.djangoproject.com/en/3.2/topics/testing/overview/#the-test-database

Top comments (0)