@@ -67,7 +67,7 @@ def test_list_diffs(self):
6767 "previous" : None ,
6868 "results" : [
6969 {
70- "id " : 3 ,
70+ "provider_id " : "PHID-DIFF-3" ,
7171 "revision" : {
7272 "id" : 1 ,
7373 "base_repository" : "http://repo.test/myrepo" ,
@@ -87,18 +87,17 @@ def test_list_diffs(self):
8787 "slug" : "myrepo-try" ,
8888 "url" : "http://repo.test/try" ,
8989 },
90- "provider_id" : "PHID-DIFF-3" ,
9190 "review_task_id" : "task-2" ,
9291 "mercurial_hash" : "30b501affc4d3b9c670fc297ab903b406afd5f04" ,
93- "issues_url" : "http://testserver/v1/diff/3/issues/" ,
92+ "issues_url" : "http://testserver/v1/diff/PHID-DIFF- 3/issues/" ,
9493 "nb_issues" : 0 ,
9594 "nb_issues_publishable" : 0 ,
9695 "nb_warnings" : 0 ,
9796 "nb_errors" : 0 ,
9897 "created" : self .now ,
9998 },
10099 {
101- "id " : 2 ,
100+ "provider_id " : "PHID-DIFF-2" ,
102101 "revision" : {
103102 "id" : 2 ,
104103 "base_repository" : "http://repo.test/myrepo" ,
@@ -118,18 +117,17 @@ def test_list_diffs(self):
118117 "slug" : "myrepo-try" ,
119118 "url" : "http://repo.test/try" ,
120119 },
121- "provider_id" : "PHID-DIFF-2" ,
122120 "review_task_id" : "task-1" ,
123121 "mercurial_hash" : "32d2a594cfef74fcb524028d1521d0d4bd98bd35" ,
124- "issues_url" : "http://testserver/v1/diff/2/issues/" ,
122+ "issues_url" : "http://testserver/v1/diff/PHID-DIFF- 2/issues/" ,
125123 "nb_issues" : 0 ,
126124 "nb_issues_publishable" : 0 ,
127125 "nb_warnings" : 0 ,
128126 "nb_errors" : 0 ,
129127 "created" : self .now ,
130128 },
131129 {
132- "id " : 1 ,
130+ "provider_id " : "PHID-DIFF-1" ,
133131 "revision" : {
134132 "id" : 1 ,
135133 "base_repository" : "http://repo.test/myrepo" ,
@@ -149,10 +147,9 @@ def test_list_diffs(self):
149147 "slug" : "myrepo-try" ,
150148 "url" : "http://repo.test/try" ,
151149 },
152- "provider_id" : "PHID-DIFF-1" ,
153150 "review_task_id" : "task-0" ,
154151 "mercurial_hash" : "a2ac78b7d12d6e55b9b15c1c2048a16c58c6c803" ,
155- "issues_url" : "http://testserver/v1/diff/1/issues/" ,
152+ "issues_url" : "http://testserver/v1/diff/PHID-DIFF- 1/issues/" ,
156153 "nb_issues" : 0 ,
157154 "nb_issues_publishable" : 0 ,
158155 "nb_warnings" : 0 ,
@@ -172,7 +169,10 @@ def test_filter_repo(self):
172169 response = self .client .get ("/v1/diff/?repository=myrepo" )
173170 self .assertEqual (response .status_code , status .HTTP_200_OK )
174171 self .assertEqual (response .json ()["count" ], 3 )
175- self .assertEqual ([d ["id" ] for d in response .json ()["results" ]], [3 , 2 , 1 ])
172+ self .assertEqual (
173+ [d ["provider_id" ] for d in response .json ()["results" ]],
174+ ["PHID-DIFF-3" , "PHID-DIFF-2" , "PHID-DIFF-1" ],
175+ )
176176
177177 # Missing repo
178178 response = self .client .get ("/v1/diff/?repository=missing" )
@@ -188,13 +188,18 @@ def test_search(self):
188188 response = self .client .get ("/v1/diff/?search=10001" )
189189 self .assertEqual (response .status_code , status .HTTP_200_OK )
190190 self .assertEqual (response .json ()["count" ], 1 )
191- self .assertEqual ([d ["id" ] for d in response .json ()["results" ]], [2 ])
191+ self .assertEqual (
192+ [d ["provider_id" ] for d in response .json ()["results" ]], ["PHID-DIFF-2" ]
193+ )
192194
193195 # In title
194196 response = self .client .get ("/v1/diff/?search=revision 1" )
195197 self .assertEqual (response .status_code , status .HTTP_200_OK )
196198 self .assertEqual (response .json ()["count" ], 2 )
197- self .assertEqual ([d ["id" ] for d in response .json ()["results" ]], [3 , 1 ])
199+ self .assertEqual (
200+ [d ["provider_id" ] for d in response .json ()["results" ]],
201+ ["PHID-DIFF-3" , "PHID-DIFF-1" ],
202+ )
198203
199204 def test_filter_issues (self ):
200205 """
@@ -205,7 +210,10 @@ def test_filter_issues(self):
205210 response = self .client .get ("/v1/diff/?issues=no" )
206211 self .assertEqual (response .status_code , status .HTTP_200_OK )
207212 self .assertEqual (response .json ()["count" ], 3 )
208- self .assertEqual ([d ["id" ] for d in response .json ()["results" ]], [3 , 2 , 1 ])
213+ self .assertEqual (
214+ [d ["provider_id" ] for d in response .json ()["results" ]],
215+ ["PHID-DIFF-3" , "PHID-DIFF-2" , "PHID-DIFF-1" ],
216+ )
209217
210218 # Any issues
211219 response = self .client .get ("/v1/diff/?issues=any" )
0 commit comments