'Ensure deletion gets denied on documents that still have references
to them.'

def test_reverse_delete_rule_deny(self):

    class BlogPost(Document, ):
        content = StringField()
        author = ReferenceField(self.Person, reverse_delete_rule=DENY)
    BlogPost.drop_collection()
    self.Person.drop_collection()
    me = self.Person(name='Test    User')
    me.save()
    post = BlogPost(content='Watching    TV', author=me)
    post.save()
    self.assertRaises(OperationError, self.Person.objects.delete)
