'Ensure that a list field may be properly saved.'

def test_save_list(self):

    class Comment(EmbeddedDocument, ):
        content = StringField()
    class BlogPost(Document, ):
        content = StringField()
        comments = ListField(EmbeddedDocumentField(Comment))
        tags = ListField(StringField())
    BlogPost.drop_collection()
    post = BlogPost(content='Went    for    a    walk    today...')
    post.tags = tags = ['fun', 'leisure']
    comments = [Comment(content='Good    for    you'), Comment(content='Yay.')]
    post.comments = comments
    post.save()
    collection = self.db[BlogPost._get_collection_name()]
    post_obj = collection.find_one()
    self.assertEqual(post_obj['tags'], tags)
    for (comment_obj, comment) in zip(post_obj['comments'], comments):
        self.assertEqual(comment_obj['content'], comment['content'])
