#NEWLINE# def test_parental_key_checks_target_is_resolved_as_class( self ) : #NEWLINE# #INDENT# from django.core import checks #NEWLINE# from django.db import models #NEWLINE# from modelcluster.fields import ParentalKey #NEWLINE# class Instrument ( models . Model ) : #NEWLINE# #INDENT# banana = ParentalKey ( 'Banana' ) #NEWLINE# class Meta ( ) : #NEWLINE# #INDENT# abstract = True #NEWLINE# #UNINDENT# #UNINDENT# errors = Instrument . check ( ) #NEWLINE# self . assertEqual ( 1 , len ( errors ) ) #NEWLINE# error = errors [ 0 ] #NEWLINE# self . assertIsInstance ( error , checks . Error ) #NEWLINE# self . assertEqual ( error . id , 'fields.E300' ) #NEWLINE# self . assertEqual ( self . obj , Instrument . banana . field ) #NEWLINE# self . assertEqual ( error . msg , "Field defines a relation with model 'Banana', which is either not installed, or is abstract." )