title: Django Unit Test - IDs of created objects
body: <p><strong>Sample models.py</strong></p>
  
  <p><em>models.py</em></p>
  
  <pre><code>class Food(models.Model):
      name = models.CharField(max_length=50, verbose_name='Food')
  
      def __str__(self):
          return self.name
  </code></pre>
  
  <p><strong>Suppose</strong> that I have written unit test/s:</p>
  
  <pre><code>from django.test import TestCase
  from myapp.models import Food
  
  class TestWhateverFunctions(TestCase):
      """
      This class contains tests for whatever functions.
      """
  
      def setUp(self):
          """
          This method runs before the execution of each test case.
          """
          Food.objects.create(name='Pizza') # Will the created object have id of 1?
          Food.objects.create(name='Pasta') # Will the created object have id of 2?
  
      def test_if_food_is_pizza(self):
          """
          Test if the given food is pizza.
          """
          food = Food.objects.get(id=1)
  
          self.assertEqual(food.name, 'Pizza')
  
      def test_if_food_is_pasta(self):
          """
          Test if the given food is pasta.
          """
          food = Food.objects.get(id=2)
  
          self.assertEqual(food.name, 'Pasta')
  </code></pre>
  
  <p>I was wondering if it's safe to assume that the id's of the created objects in <strong>setUp() method</strong> will always start at <code>id 1</code> and so on and so forth? If not, is there a specific reason why if the test database is always <strong>destroyed</strong> after running all tests?</p>