'Ensure we dereference list data correctly'

def test_list_lookup_not_checked_in_map(self):

    class Comment(Document, ):
        id = IntField(primary_key=True)
        text = StringField()
    class Message(Document, ):
        id = IntField(primary_key=True)
        comments = ListField(ReferenceField(Comment))
    Comment.drop_collection()
    Message.drop_collection()
    c1 = Comment(id=0, text='zero').save()
    c2 = Comment(id=1, text='one').save()
    Message(id=1, comments=[c1, c2]).save()
    msg = Message.objects.get(id=1)
    self.assertEqual(0, msg.comments[0].id)
    self.assertEqual(1, msg.comments[1].id)
