#NEWLINE# def test_create_with_special_properties( self ) : #NEWLINE# #INDENT# res = self . client . get ( '/edit/authors/create/special/' ) #NEWLINE# self . assertEqual ( res . status_code , 200 ) #NEWLINE# self . assertTrue ( isinstance ( res . context [ 'form' ] , views . AuthorForm ) ) #NEWLINE# self . assertFalse ( ( 'object' in res . context ) ) #NEWLINE# self . assertFalse ( ( 'author' in res . context ) ) #NEWLINE# self . assertTemplateUsed ( res , 'generic_views/form.html' ) #NEWLINE# res = self . client . post ( '/edit/authors/create/special/' , { #NEWLINE# #INDENT# 'name' : 'Randall Munroe' , #NEWLINE# 'slug' : 'randall-munroe' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( res . status_code , 302 ) #NEWLINE# obj = Author . objects . get ( slug = 'randall-munroe' ) #NEWLINE# self . assertRedirects ( obj , reverse ( 'author_detail' , kwargs = { #NEWLINE# #INDENT# 'pk' : obj . pk , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertQuerysetEqual ( Author . objects . all ( ) , [ '<Author: Randall Munroe>' ] )