title: Django: change media root for tests
body: <p>I am trying to write some tests for a Django application, involving file upload. For that, I want to change the <code>MEDIA_ROOT</code> temporarily to 'myproject/fixtures/test_media/'. For some reason it seems that this prevents Django to find the fixtures.</p>
  
  <p>My test case looks like</p>
  
  <pre><code>from django.conf import settings
  
  class TestMedia(TestCase):
      fixtures = ['fixtures/test_data.json']
  
      def setUp(self):
          settings.MEDIA_ROOT = ''.join(
              [settings.PROJECT_PATH, '/fixtures/test_media/'])
  
      def test_photo_size(self):
          pass # Actually do something with the media files
  </code></pre>
  
  <p>For some reason, Django cannot then load the fixtures, hence all tests fail with</p>
  
  <blockquote>
    <p>Problem installing fixture 'fixtures/test_data.json': Traceback (most recent call last)
    ...</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>