'Ensure cascading deletion of referring documents from the database
does not fail on abstract document.'

def test_reverse_delete_rule_cascade_on_abstract_document(self):

    class AbstractBlogPost(Document, ):
        meta = {'abstract': True}
        author = ReferenceField(self.Person, reverse_delete_rule=CASCADE)
    class BlogPost(AbstractBlogPost, ):
        content = StringField()
    BlogPost.drop_collection()
    me = self.Person(name='Test    User')
    me.save()
    someoneelse = self.Person(name='Some-one    Else')
    someoneelse.save()
    BlogPost(content='Watching    TV', author=me).save()
    BlogPost(content='Chilling    out', author=me).save()
    BlogPost(content='Pro    Testing', author=someoneelse).save()
    self.assertEqual(3, BlogPost.objects.count())
    self.Person.objects(name='Test    User').delete()
    self.assertEqual(1, BlogPost.objects.count())
