@@ -209,6 +209,26 @@ def test_can_create_same_label_in_multiple_projects(self):
209209 response = self .client .post (self .other_url , format = 'json' , data = label )
210210 self .assertEqual (response .status_code , status .HTTP_201_CREATED )
211211
212+ def test_can_create_same_suffix_with_different_prefix (self ):
213+ self .client .login (username = self .super_user_name ,
214+ password = self .super_user_pass )
215+ label = {'text' : 'Person' , 'prefix_key' : None , 'suffix_key' : 'p' }
216+ response = self .client .post (self .url , format = 'json' , data = label )
217+ self .assertEqual (response .status_code , status .HTTP_201_CREATED )
218+ label = {'text' : 'Percentage' , 'prefix_key' : 'ctrl' , 'suffix_key' : 'p' }
219+ response = self .client .post (self .url , format = 'json' , data = label )
220+ self .assertEqual (response .status_code , status .HTTP_201_CREATED )
221+
222+ def test_cannot_create_same_shortcut_key (self ):
223+ self .client .login (username = self .super_user_name ,
224+ password = self .super_user_pass )
225+ label = {'text' : 'Person' , 'prefix_key' : None , 'suffix_key' : 'p' }
226+ response = self .client .post (self .url , format = 'json' , data = label )
227+ self .assertEqual (response .status_code , status .HTTP_201_CREATED )
228+ label = {'text' : 'Percentage' , 'prefix_key' : None , 'suffix_key' : 'p' }
229+ response = self .client .post (self .url , format = 'json' , data = label )
230+ self .assertEqual (response .status_code , status .HTTP_400_BAD_REQUEST )
231+
212232 def test_disallows_project_member_to_create_label (self ):
213233 self .client .login (username = self .project_member_name ,
214234 password = self .project_member_pass )
0 commit comments