#NEWLINE# def test_allow_inheritance_abstract_document( self ) : #NEWLINE# #INDENT# 'Ensure that abstract documents can set inheritance rules and that\n        _cls will not be used.\n        ' #NEWLINE# class FinalDocument ( Document ) : #NEWLINE# #INDENT# meta = { #NEWLINE# #INDENT# 'abstract' : True , #NEWLINE# 'allow_inheritance' : False , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# class Animal ( FinalDocument ) : #NEWLINE# #INDENT# name = StringField ( ) #NEWLINE# #UNINDENT# def create_mammal_class( ) : #NEWLINE# #INDENT# class Mammal ( Animal ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# self . assertRaises ( ValueError , create_mammal_class ) #NEWLINE# doc = Animal ( name = 'dog' ) #NEWLINE# self . assertFalse ( ( '_cls' in doc . to_mongo ( ) ) )