title: django.db.utils.IntegrityError: Problem installing fixture
body: <p>I'm attempting to create a fixture from my development database data and storing it my test database. This data happens to be only one model. I ran the <code>dumpdata</code> command as such:</p>
  
  <p><code>python manage.py dumpdata minerals.mineral --all --indent=4 
  --output=minerals/test_minerals/fixtures/test_mineral_data.json</code></p>
  
  <p>When attempting to run the <code>python manage.py test</code>, the following error is raised:</p>
  
  <p><code>django.db.utils.IntegrityError: Problem installing fixture 
  '../minerals/test_minerals/fixtures/test_mineral_data.json': 
  Could not load minerals.Mineral(pk=872): UNIQUE constraint failed: minerals_mineral.name</code></p>
  
  <p><a href="https://docs.djangoproject.com/en/2.2/topics/testing/tools/#django.test.TransactionTestCase.fixtures" rel="nofollow noreferrer">https://docs.djangoproject.com/en/2.2/topics/testing/tools/#django.test.TransactionTestCase.fixtures</a></p>
  
  <blockquote>
    <p>By default, fixtures are only loaded into the default database. </p>
  </blockquote>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  </code></pre>
  
  <p>I was under the initial impression that fixtures were stored in an empty database when attempting to unit test but apparently that is incorrect? What can be done to emulate the data so I can test?</p>
  
  <p><strong>tests.py</strong></p>
  
  <pre><code>class SearchFormResults(TestCase):
  
      fixtures = ['minerals/test_minerals/fixtures/test_mineral_data.json']
  
      def test_user_search_query_fail(self):
          response = self.client.get(
              reverse("minerals:search_list"), data={'query': 'Kryptonite'},
              HTTP_REFERRER=reverse(
                  "minerals:letter_list", kwargs={'query': 'N'}
              ), follow=True
          )
  </code></pre>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Mineral(models.Model):
      name = models.CharField(unique=True, max_length=255)
      image_filename = models.ImageField(max_length=255, blank=True)
      image_caption = models.CharField(max_length=255, blank=True)
      category = models.CharField(max_length=255, blank=True)
      formula = models.CharField(max_length=255, blank=True)
      strunz_classification = models.CharField(max_length=255, blank=True)
      crystal_system = models.CharField(max_length=255, blank=True)
      unit_cell = models.CharField(max_length=255, blank=True)
      color = models.CharField(max_length=255, blank=True)
      crystal_symmetry = models.CharField(max_length=255, blank=True)
      cleavage = models.CharField(max_length=255, blank=True)
      mohs_scale_hardness = models.CharField(max_length=255, blank=True)
      luster = models.CharField(max_length=255, blank=True)
      streak = models.CharField(max_length=255, blank=True)
      diaphaneity = models.CharField(max_length=255, blank=True)
      optical_properties = models.CharField(max_length=255, blank=True)
      refractive_index = models.CharField(max_length=255, blank=True)
      crystal_habit = models.CharField(max_length=255, blank=True)
      specific_gravity = models.CharField(max_length=255, blank=True)
      group = models.CharField(max_length=255, blank=True)
  
      def __str__(self):
          return self.name
  </code></pre>