#NEWLINE# def test_flatpage_admin_form_url_uniqueness_validation( self ) : #NEWLINE# #INDENT# 'The flatpage admin form correctly enforces url uniqueness among flatpages of the same site' #NEWLINE# data = dict ( url = '/myflatpage1/' , ** self . form_data ) #NEWLINE# FlatpageForm ( data = data ) . save ( ) #NEWLINE# f = FlatpageForm ( data = data ) #NEWLINE# self . assertFalse ( f . is_valid ( ) ) #NEWLINE# self . assertEqual ( data . errors , { #NEWLINE# #INDENT# '__all__' : [ 'Flatpage with url /myflatpage1/ already exists for site example.com' ] , #NEWLINE# #UNINDENT# } )