I have a bunch of unit test files, all of which consist of django.test.TestCase classes.
Wrote a small script shell to uncomment / comment on test file files in my __init__.py file, so I can run tests from specific test files based on the command line arguments that I give them. I can also run all tests of all test files at once (for regression testing purposes).
I have one test file in which there are some JSON devices, and the first test checks that a certain model / table has 3 entries in it (defined by a JSON application).
So, here is the problem: when I run this test file myself, its tests pass with flying colors, but when I run the test with all the other tests, this specific test case that I mentioned fails.
When I run all the tests, the database says that there are 6 entries in the table / model, but there should only be 3 (from the device), for example, when the test file runs by itself.
I also tried to run this test file with several other test files (not all), and it passes. Thus, the only time this is not the case is when all the test files are running.
It seems to me that this is a bug in Django or PostgreSQL (I use DB), because it is not Django TestCases that should automatically reset / reset the database between each test method, not to mention the testing class?
source share