@@ -152,8 +152,10 @@ def setUpTestData(cls):
152152 cls .main_project_label = mommy .make ('server.Label' , project = cls .main_project )
153153
154154 sub_project = mommy .make ('server.Project' , users = [non_project_member ])
155+ other_project = mommy .make ('server.Project' , users = [super_user ])
155156 mommy .make ('server.Label' , project = sub_project )
156157 cls .url = reverse (viewname = 'label_list' , args = [cls .main_project .id ])
158+ cls .other_url = reverse (viewname = 'label_list' , args = [other_project .id ])
157159 cls .data = {'text' : 'example' }
158160
159161 def test_returns_labels_to_project_member (self ):
@@ -194,6 +196,15 @@ def test_can_create_multiple_labels_without_shortcut_key(self):
194196 response = self .client .post (self .url , format = 'json' , data = label )
195197 self .assertEqual (response .status_code , status .HTTP_201_CREATED )
196198
199+ def test_can_create_same_label_in_multiple_projects (self ):
200+ self .client .login (username = self .super_user_name ,
201+ password = self .super_user_pass )
202+ label = {'text' : 'LOC' , 'prefix_key' : None , 'suffix_key' : 'l' }
203+ response = self .client .post (self .url , format = 'json' , data = label )
204+ self .assertEqual (response .status_code , status .HTTP_201_CREATED )
205+ response = self .client .post (self .other_url , format = 'json' , data = label )
206+ self .assertEqual (response .status_code , status .HTTP_201_CREATED )
207+
197208 def test_disallows_project_member_to_create_label (self ):
198209 self .client .login (username = self .project_member_name ,
199210 password = self .project_member_pass )
0 commit comments