#NEWLINE# def test_creates_project_from_template( self ) : #NEWLINE# #INDENT# template_from = ProjectFactory ( creator = self . user_one , is_public = True ) #NEWLINE# template_component = ProjectFactory ( creator = self . user_one , is_public = True , parent = template_from ) #NEWLINE# templated_project_title = 'Templated Project' #NEWLINE# templated_project_data = { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'type' : 'nodes' , #NEWLINE# 'attributes' : { #NEWLINE# #INDENT# 'title' : templated_project_title , #NEWLINE# 'category' : self . category , #NEWLINE# 'template_from' : template_from . _id , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# res = self . app . post_json_api ( self . url , templated_project_data , auth = self . user_one . auth ) #NEWLINE# assert_equal ( res . status_code , 201 ) #NEWLINE# json_data = res . json [ 'data' ] #NEWLINE# new_project_id = json_data [ 'id' ] #NEWLINE# new_project = Node . load ( new_project_id ) #NEWLINE# assert_equal ( new_project . title , templated_project_title ) #NEWLINE# assert_equal ( new_project . description , None ) #NEWLINE# assert_false ( new_project . is_public ) #NEWLINE# assert_equal ( len ( new_project . nodes ) , len ( template_from . nodes ) ) #NEWLINE# assert_equal ( new_project . nodes [ 0 ] . title , template_component . title )