title: Django - Cannot assign, must be a instance
body: <p>This issue was raised several times, though I guess I'm getting it from a different reason, or at least I can't tell how it's related.</p>
  
  <p>Django: 1.10.5, Python: 3.5.2, Postgres: 9.5</p>
  
  <p>So, I have such models (simplified):</p>
  
  <pre><code>class Parent(models.Model):
      id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
      date_created = models.DateTimeField(auto_now=True)
  
  class Child(models.Model):
      id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
      date_created = models.DateTimeField(auto_now=True)
      parent = models.ForeignKey(Parent)
  
      def __init__(self, parent, *args, **kwargs):
          super(Child, self).__init__(*args, **kwargs)
          self.parent = parent
  </code></pre>
  
  <p>I have a custom queryset:</p>
  
  <pre><code>class ChildQuerySet(models.query.QuerySet):
  
      def find_recent(self):
          return self.order_by('-date_created')
  
  Child.objects = ChildQuerySet.as_manager()
  </code></pre>
  
  <p>Then, I'm trying to test some custom queryset method for child:</p>
  
  <pre><code>class ChildQuerysetDatabaseIntegrationTest(TestCase): # from django.test
      default_parent = Parent()
  
      def setUp(self):
          super(ChildQuerysetDatabaseIntegrationTest, self).setUp()
          self.default_parent.save()
  
      def test_find_recent(self):
          # given
          for _ in range(1, 10):
              child = Child(self.default_parent)
              child.save()
  
          # when
          recent = Child.objects.find_recent()
          ordered = Child.objects.order_by('-date_created')
  
          # then
          self.assertEqual(list(ordered), list(recent))
  </code></pre>
  
  <p>This produces following error on the last line of test (fetching all entities):</p>
  
  <pre><code>ValueError: Cannot assign "UUID('...')": "Child.parent" must be a "Parent" instance.
  </code></pre>
  
  <p>Usually, when there's some mapping error, the error is thrown during entity saving, but here everything seems to persist successfully, but then fails on retrieval.</p>
  
  <p>The UUID object that is tried to be assigned to parent instance, is actually child's id object, which makes me even more confused.</p>
  
  <p>I tried changing object creation to Parent.objects.create(), but the result didn't change. Calling any function that retrieves a Child object, like ordered.first(), also fails, so I have no clue what's happening.</p>