title: Unit testing in Django: How to initialize database
body: <p>I am trying to do Test Driven Development with Django. My problem is that I need to add some things in the database before running the tests, for instance a number of users, departments and their permissions. I tried to do that using fixtures but I really find the whole process very unintuitive (also I found out that when I deleted and re-synced my database, my users fixtures were broken because the permissions are referenced only through the id)!</p>
  
  <p>I have searched for other solutions to this pre-test database initialization, but I was able to only find very simple cases in which the initialization is performed in the setUp method of the TestCase class. I don't really thing that such methods could be used when you have an application with different users and permissions that all need to be tested.</p>
  
  <p>Can you tell me how you fill your database before starting your tests for a big application ? Is there any better methods other than fixtures and setUp class ? </p>