title: how to test a model that has a foreign key in django?
body: <p>I'm using python 3.5 and Django 1.10 and trying to test my app in tests.py, but an error appeared, it said: <code>ValueError: Cannot assign "1": "NewsLetter.UserID" must be a "User" instance.</code> so how to test a fk value here?
  here is the code:</p>
  
  <pre><code>class NewsletterModelTest(TestCase):
  
      @classmethod
      def setUpTestData(cls):
          #Set up non-modified objects used by all test methods
          NewsLetter.objects.create(NewsLetterID=1, Email='test@test.com', Connected=False,UserID=1)
  
  
      class NewsLetter(models.Model):
           NewsLetterID = models.AutoField(primary_key=True)
           Email = models.CharField(max_length=255)
           Connected = models.BooleanField(default=False)
           UserID = models.ForeignKey(User, on_delete=models.CASCADE)
           class Meta:
                db_table = 'NewsLetter'
  </code></pre>