title: Does Django Rest Framework tests use a "mock" database?
body: <p>I am trying to come up with the best way to test a POST only endpoint, which takes a payload and creates 6 different objects from that data.  I am trying to send the payload and then assert that all the objects that should have been created, are created.  The last block (after the new lines), is trying to repost the same load and ensure that no duplicates were created.  </p>
  
  <p>My question is if I run this test, is this using the existing database?  Or is it setting up a "mock" database and tearing it down after the test runs?  I don't want any of this data dirting up my db.</p>
  
  <pre><code>class APITests(APITestCase):
      def test_job_start(self):
          url = '/api/v1/job_start/'
          response = self.client.post(url, data, format='json')
          self.assertEqual(response.status_code, status.HTTP_201_CREATED)
          self.assertEqual(Platform.objects.count(), 1)
          self.assertEqual(Platform.objects.get().name, 'andr')
          self.assertEqual(CdTool.objects.count(), 1)
          self.assertEqual(CdTool.objects.get().name, 'https://jenkins-andr.test.com')
          self.assertEqual(Job.objects.count(), 1)
          self.assertEqual(Job.objects.get().name, 'ANDR_master_CI')
          self.assertEqual(JobExecution.objects.count(), 1)
          self.assertEqual(JobExecution.objects.get().build_id, '3500')
  
  
          # Send the same payload, make sure no duplicate records are created
          response = self.client.post(url, data, format='json')
          self.assertEqual(Platform.objects.count(), 1)
          self.assertEqual(CdTool.objects.count(), 1)
          self.assertEqual(Job.objects.count(), 1)
          self.assertEqual(JobExecution.objects.count(), 1)
  </code></pre>