#NEWLINE# def test_parental_key_checks_related_name_is_not_plus( 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# band = ParentalKey ( Band , related_name = '+' ) #NEWLINE# class Meta ( ) : #NEWLINE# #INDENT# abstract = True #NEWLINE# #UNINDENT# #UNINDENT# errors = Instrument . check ( ) #NEWLINE# self . assertEqual ( 1 , len ( self ) ) #NEWLINE# error = errors [ 0 ] #NEWLINE# self . assertIsInstance ( error , checks . Error ) #NEWLINE# self . assertEqual ( error . id , 'modelcluster.E002' ) #NEWLINE# self . assertEqual ( error . obj , Instrument . band . field ) #NEWLINE# self . assertEqual ( error . msg , "related_name='+' is not allowed on ParentalKey fields" ) #NEWLINE# self . assertEqual ( error . hint , 'Either change it to a valid name or remove it' )