'Ensure that query values are properly converted when necessary.'

def test_query_value_conversion(self):

    class BlogPost(Document, ):
        author = ReferenceField(self.Person)
    BlogPost.drop_collection()
    person = self.Person(name='test', age=30)
    person.save()
    post = BlogPost(author=person)
    post.save()
    post_obj = BlogPost.objects(author=person).first()
    self.assertEqual(post.id, post_obj.id)
    post_obj = BlogPost.objects(author__in=[person]).first()
    self.assertEqual(post.id, post_obj.id)
    BlogPost.drop_collection()
