@@ -256,7 +256,9 @@ def setUpTestData(cls):
256
256
257
257
project = mommy .make ('Project' , users = [project_member , super_user ])
258
258
cls .label = mommy .make ('Label' , project = project )
259
+ cls .label_with_shortcut = mommy .make ('Label' , suffix_key = 'l' , project = project )
259
260
cls .url = reverse (viewname = 'label_detail' , args = [project .id , cls .label .id ])
261
+ cls .url_with_shortcut = reverse (viewname = 'label_detail' , args = [project .id , cls .label_with_shortcut .id ])
260
262
cls .data = {'text' : 'example' }
261
263
262
264
def test_returns_label_to_project_member (self ):
@@ -277,6 +279,12 @@ def test_allows_superuser_to_update_label(self):
277
279
response = self .client .patch (self .url , format = 'json' , data = self .data )
278
280
self .assertEqual (response .data ['text' ], self .data ['text' ])
279
281
282
+ def test_allows_superuser_to_update_label_with_shortcut (self ):
283
+ self .client .login (username = self .super_user_name ,
284
+ password = self .super_user_pass )
285
+ response = self .client .patch (self .url_with_shortcut , format = 'json' , data = {'suffix_key' : 's' })
286
+ self .assertEqual (response .data ['suffix_key' ], 's' )
287
+
280
288
def test_disallows_project_member_to_update_label (self ):
281
289
self .client .login (username = self .project_member_name ,
282
290
password = self .project_member_pass )
0 commit comments