#NEWLINE# def test_topic_publish_invalid_removed_subcategory( self ) : #NEWLINE# #INDENT# '\n        invalid removed subcategory\n        ' #NEWLINE# category = utils . create_category ( ) #NEWLINE# subcategory = utils . create_subcategory ( category , is_removed = True ) #NEWLINE# form_data = { #NEWLINE# #INDENT# 'comment' : 'foo' , #NEWLINE# 'title' : 'foobar' , #NEWLINE# 'category' : subcategory . pk , #NEWLINE# #UNINDENT# } #NEWLINE# form = TopicForm ( self . user , data = form_data ) #NEWLINE# self . assertEqual ( form . is_valid ( ) , False ) #NEWLINE# self . assertNotIn ( 'category' , form . cleaned_data )