#NEWLINE# def test_explicit_swappable_manager( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# old_app_models = copy . deepcopy ( cache . app_models ) #NEWLINE# old_app_store = copy . deepcopy ( cache . app_store ) #NEWLINE# settings . TEST_SWAPPABLE_MODEL = 'managers_regress.Parent' #NEWLINE# class SwappableModel ( models . Model ) : #NEWLINE# #INDENT# objects = models . Manager ( ) #NEWLINE# class Meta ( ) : #NEWLINE# #INDENT# swappable = 'TEST_SWAPPABLE_MODEL' #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# SwappableModel . objects . all ( ) #NEWLINE# self . fail ( 'Should raise an AttributeError' ) #NEWLINE# #UNINDENT# except AttributeError as e : #NEWLINE# #INDENT# self . assertEqual ( str ( e ) , "Manager isn't available; SwappableModel has been swapped for 'managers_regress.Parent'" ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# del settings . TEST_SWAPPABLE_MODEL #NEWLINE# cache . app_models = old_app_models #NEWLINE# cache . app_store = old_app_store