@@ -88,7 +88,7 @@ def test_authenticate_user_internal(self):
8888 response = self .post (self .authenticate_user_internal_url , None )
8989 assert response .status_code == 200
9090 data = json .loads (response .content )
91- assert data ["success" ] == True
91+ assert data ["success" ]
9292 assert data ["username" ] == user ().email
9393
9494 def test_check_version_bad_request (self ):
@@ -184,6 +184,32 @@ def test_add_nodes(self):
184184 response .content
185185 )
186186
187+ def test_add_node_with_tags (self ):
188+ response = self .post (
189+ self .create_channel_url , {"channel_data" : channel_metadata }
190+ )
191+ assert response .status_code == 200
192+ data = json .loads (response .content )
193+ assert "root" in data
194+
195+ node_data = node_json (
196+ {"kind" : "video" , "license" : cc .License .objects .all ()[0 ].license_name }
197+ )
198+ unique_title = "This is a title that we can almost certainly find uniquely later"
199+ node_data ["tags" ] = ["test" ]
200+ node_data ["title" ] = unique_title
201+ response = self .post (
202+ self .add_nodes_url , {"root_id" : data ["root" ], "content_data" : [node_data ]}
203+ )
204+ assert response .status_code == 200 , "Call failed:\n output: {}" .format (
205+ response .content
206+ )
207+
208+ node = cc .ContentNode .objects .get (title = unique_title )
209+
210+ self .assertEqual (node .tags .count (), 1 )
211+ self .assertEqual (node .tags .first ().tag_name , "test" )
212+
187213 def test_finish_channel_bad_request (self ):
188214 response = self .post (self .finish_channel_url , {})
189215 assert response .status_code == 400
0 commit comments