'Ensure pulling of references to deleted documents when reference
is defined on an abstract document..'

def test_reverse_delete_rule_pull_on_abstract_documents(self):

    class AbstractBlogPost(Document, ):
        meta = {'abstract': True}
        authors = ListField(ReferenceField(self.Person, reverse_delete_rule=PULL))
    class BlogPost(AbstractBlogPost, ):
        content = StringField()
    BlogPost.drop_collection()
    self.Person.drop_collection()
    me = self.Person(name='Test    User')
    me.save()
    someoneelse = self.Person(name='Some-one    Else')
    someoneelse.save()
    post = BlogPost(content='Watching    TV', authors=[me, someoneelse])
    post.save()
    another = BlogPost(content='Chilling    Out', authors=[someoneelse])
    another.save()
    someoneelse.delete()
    post.reload()
    another.reload()
    self.assertEqual(post.authors, [me])
    self.assertEqual(another.authors, [])
