'Raise an error if loading invalid data.'

def test_invalid_son(self):

    class Occurrence(EmbeddedDocument, ):
        number = IntField()
    class Word(Document, ):
        stem = StringField()
        count = IntField(default=1)
        forms = ListField(StringField(), default=list)
        occurs = ListField(EmbeddedDocumentField(Occurrence), default=list)
    with self.assertRaises(InvalidDocumentError):
        Word._from_son({'stem': [1, 2, 3], 'forms': 1, 'count': 'one', 'occurs': {'hello': None}})
    with self.assertRaises(ValueError):
        Word._from_son('this    is    not    a    valid    SON    dict')
