title: How to run Django's test database only in memory?
body: <p>My Django unit tests take a long time to run, so I'm looking for ways to speed that up. I'm considering installing an <a href="http://en.wikipedia.org/wiki/Solid-state_drive" rel="noreferrer">SSD</a>, but I know that has its downsides too. Of course, there are things I could do with my code, but I'm looking for a structural fix. Even running a single test is slow since the database needs to be rebuilt / south migrated every time. So here's my idea...</p>
  
  <p>Since I know the test database will always be quite small, why can't I just configure the system to always keep the entire test database in RAM? Never touch the disk at all. How do I configure this in Django?  I'd prefer to keep using <a href="http://en.wikipedia.org/wiki/MySQL" rel="noreferrer">MySQL</a> since that's what I use in production, but if <a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a>&nbsp;3 or something else makes this easy, I'd go that way.</p>
  
  <p>Does SQLite or MySQL have an option to run entirely in memory? It should be possible to configure a RAM disk and then configure the test database to store its data there, but I'm not sure how to tell Django / MySQL to use a different data directory for a certain database, especially since it keeps getting erased and recreated each run. (I'm on a Mac FWIW.)</p>