#NEWLINE# @ attr ( 'categories' ) #NEWLINE# def test_category_post( self ) : #NEWLINE# #INDENT# post = WordPressPost ( ) #NEWLINE# post . title = 'Test Post' #NEWLINE# post . slug = 'test-post' #NEWLINE# post . user = self . userid #NEWLINE# post . id = self . client . call ( posts . NewPost ( post ) ) #NEWLINE# cat = WordPressTerm ( ) #NEWLINE# cat . name = 'Test Category' #NEWLINE# cat . taxonomy = 'category' #NEWLINE# cat . id = self . client . call ( taxonomies . NewTerm ( cat ) ) #NEWLINE# try : #NEWLINE# #INDENT# post . terms = [ cat ] #NEWLINE# response = self . client . call ( posts . EditPost ( post . id , post ) ) #NEWLINE# self . assertTrue ( response ) #NEWLINE# post2 = self . client . call ( posts . GetPost ( post . id , [ 'terms' ] ) ) #NEWLINE# post_cats = post2 . terms #NEWLINE# self . assert_list_of_classes ( self , WordPressTerm ) #NEWLINE# self . assertEqual ( post_cats [ 0 ] . id , cat . id ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . client . call ( taxonomies . DeleteTerm ( cat . taxonomy , cat . id ) ) #NEWLINE# self . client . call ( posts . DeletePost ( post . id ) )