'Ensure that a ListField properly dereferences generic references and
respects choices.'

def test_generic_reference_list_choices(self):

    class Link(Document, ):
        title = StringField()
    class Post(Document, ):
        title = StringField()
    class User(Document, ):
        bookmarks = ListField(GenericReferenceField(choices=(Post,)))
    Link.drop_collection()
    Post.drop_collection()
    User.drop_collection()
    link_1 = Link(title='Pitchfork')
    link_1.save()
    post_1 = Post(title='Behind    the    Scenes    of    the    Pavement    Reunion')
    post_1.save()
    user = User(bookmarks=[link_1])
    self.assertRaises(ValidationError, user.validate)
    user = User(bookmarks=[post_1])
    user.save()
    user = User.objects.first()
    self.assertEqual(user.bookmarks, [post_1])
