[Django]-Django test DB returning nothing

3👍

Actually, according to the Django tutorial, the database is rolled back between each test. (See the bottom of the linked section.)

If you’re looking to have a common setup between tests, you should consider overriding the TestCase method setUp. This is run before each test function. The unittest documentation should be helpful for this, and Django has an example in their documentation as well.

👤jb326

Leave a comment