#NEWLINE# def test_can_create_and_continue_editing_a_product( self ) : #NEWLINE# #INDENT# category = CategoryFactory ( ) #NEWLINE# product_class = ProductClass . objects . create ( name = 'Book' ) #NEWLINE# page = self . get ( reverse ( 'dashboard:catalogue-product-create' , args = ( product . slug , ) ) ) #NEWLINE# form = page . form #NEWLINE# form [ 'upc' ] = '123456' #NEWLINE# form [ 'title' ] = 'new product' #NEWLINE# form [ 'productcategory_set-0-category' ] = category . id #NEWLINE# form [ 'stockrecords-0-partner' ] = self . partner . id #NEWLINE# form [ 'stockrecords-0-partner_sku' ] = '14' #NEWLINE# form [ 'stockrecords-0-num_in_stock' ] = '555' #NEWLINE# form [ 'stockrecords-0-price_excl_tax' ] = '13.99' #NEWLINE# page = form . submit ( name = 'action' , value = 'continue' ) #NEWLINE# self . assertEqual ( Product . objects . count ( ) , 1 ) #NEWLINE# product = Product . objects . all ( ) [ 0 ] #NEWLINE# self . assertEqual ( product . stockrecords . all ( ) [ 0 ] . partner , self . partner ) #NEWLINE# self . assertRedirects ( page , reverse ( 'dashboard:catalogue-product' , kwargs = { #NEWLINE# #INDENT# 'pk' : product . id , #NEWLINE# #UNINDENT# } ) )