1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
|
Description: expect new spelling/format of error messages
Origin: upstream 349fe5a9 + efc12ec5 + 1a5c449c +
19d2b27b + f9185cd0 + 061d07ec + 2dfe6da4 + a2b3d943
Author: Dominik Wombacher, Michal Konečný
Forwarded: not-needed
--- a/tests/test_pagure_flask_api_issue.py
+++ b/tests/test_pagure_flask_api_issue.py
@@ -671,7 +671,7 @@ class PagureFlaskApiIssuetests(tests.Sim
{
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"milestone": ["Not a valid choice"]},
+ "errors": {"milestone": ["Not a valid choice."]},
},
)
@@ -3160,7 +3160,7 @@ class PagureFlaskApiIssuetests(tests.Sim
{
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"milestone": ["Not a valid choice"]},
+ "errors": {"milestone": ["Not a valid choice."]},
},
)
--- a/tests/test_pagure_flask_api_issue_change_status.py
+++ b/tests/test_pagure_flask_api_issue_change_status.py
@@ -159,7 +159,7 @@ class PagureFlaskApiIssueChangeStatustes
{
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"status": ["Not a valid choice"]},
+ "errors": {"status": ["Not a valid choice."]},
},
)
--- a/tests/test_pagure_flask_api_pr_flag.py
+++ b/tests/test_pagure_flask_api_pr_flag.py
@@ -902,7 +902,7 @@ class PagureFlaskApiPRFlagtests(tests.Mo
{
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"status": ["Not a valid choice"]},
+ "errors": {"status": ["Not a valid choice."]},
},
)
@@ -1059,7 +1059,7 @@ class PagureFlaskApiPRFlagUserTokentests
{
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"status": ["Not a valid choice"]},
+ "errors": {"status": ["Not a valid choice."]},
},
)
--- a/tests/test_pagure_flask_api_project.py
+++ b/tests/test_pagure_flask_api_project.py
@@ -2780,7 +2780,7 @@ class PagureFlaskApiProjectFlagtests(tes
expected_output = {
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"status": ["Not a valid choice"]},
+ "errors": {"status": ["Not a valid choice."]},
}
if self.get_wtforms_version() >= (2, 3):
expected_output["errors"]["status"] = ["This field is required."]
@@ -2919,7 +2919,7 @@ class PagureFlaskApiProjectFlagtests(tes
self.assertEqual(
data,
{
- "errors": {"status": ["Not a valid choice"]},
+ "errors": {"status": ["Not a valid choice."]},
"error_code": "EINVALIDREQ",
"error": "Invalid or incomplete input submitted",
},
@@ -3371,7 +3371,7 @@ class PagureFlaskApiProjectFlagtests(tes
self.assertEqual(
data,
{
- "errors": {"status": ["Not a valid choice"]},
+ "errors": {"status": ["Not a valid choice."]},
"error_code": "EINVALIDREQ",
"error": "Invalid or incomplete input submitted",
},
@@ -3582,7 +3582,7 @@ class PagureFlaskApiProjectModifyAclTest
"error_code": "EINVALIDREQ",
"errors": {
"name": ["This field is required."],
- "user_type": ["Not a valid choice"],
+ "user_type": ["Not a valid choice."],
},
}
if self.get_wtforms_version() >= (2, 3):
@@ -3605,7 +3605,7 @@ class PagureFlaskApiProjectModifyAclTest
expected_output = {
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"acl": ["Not a valid choice"]},
+ "errors": {"acl": ["Not a valid choice."]},
}
self.assertEqual(data, expected_output)
@@ -5669,7 +5669,7 @@ class PagureFlaskApiProjectCreateProject
{
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"namespace": ["Not a valid choice"]},
+ "errors": {"namespace": ["Not a valid choice."]},
},
)
--- a/tests/test_pagure_flask_api_ui_private_repo.py
+++ b/tests/test_pagure_flask_api_ui_private_repo.py
@@ -3244,7 +3244,7 @@ class PagurePrivateRepotest(tests.Modelt
{
"error": "Invalid or incomplete input submitted",
"error_code": "EINVALIDREQ",
- "errors": {"status": ["Not a valid choice"]},
+ "errors": {"status": ["Not a valid choice."]},
},
)
--- a/tests/test_pagure_flask_api_user.py
+++ b/tests/test_pagure_flask_api_user.py
@@ -378,7 +378,7 @@ class PagureFlaskApiUSertests(tests.Mode
"error": "Could not match input '2016asd' to any of the following formats: "
"YYYY-MM-DD, YYYY-M-DD, YYYY-M-D, YYYY/MM/DD, YYYY/M/DD, YYYY/M/D, "
"YYYY.MM.DD, YYYY.M.DD, YYYY.M.D, YYYYMMDD, YYYY-DDDD, YYYYDDDD, "
- "YYYY-MM, YYYY/MM, YYYY.MM, YYYY, W",
+ "YYYY-MM, YYYY/MM, YYYY.MM, YYYY, W.",
"error_code": "ENOCODE",
}
self.assertEqual(json.loads(output.get_data(as_text=True)), exp)
--- a/tests/test_pagure_flask_ui_remote_pr.py
+++ b/tests/test_pagure_flask_ui_remote_pr.py
@@ -20,6 +20,7 @@ import time
import unittest
import pygit2
+import werkzeug
import wtforms
from mock import patch, MagicMock
from bs4 import BeautifulSoup
@@ -173,9 +174,21 @@ class PagureRemotePRtests(tests.Modeltes
# Try creating a remote PR
output = self.app.get("/test/diff/remote")
self.assertEqual(output.status_code, 302)
- self.assertIn(
+ expected_response = (
"You should be redirected automatically to target URL: "
- '<a href="/login/?',
+ '<a href="/login/?'
+ )
+ if hasattr(werkzeug, "__version__"):
+ werkzeug_v = tuple(
+ int(el) for el in werkzeug.__version__.split(".")
+ )
+ if werkzeug_v >= (2, 1, 2):
+ expected_response = (
+ "You should be redirected automatically to the target URL: "
+ '<a href="/login/?'
+ )
+ self.assertIn(
+ expected_response,
output.get_data(as_text=True),
)
--- a/tests/test_pagure_flask_ui_issues_acl_checks.py
+++ b/tests/test_pagure_flask_ui_issues_acl_checks.py
@@ -109,7 +109,7 @@ class PagureFlaskIssuesACLtests(tests.Mo
output.get_data(as_text=True),
)
self.assertTrue(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket."
in output.get_data(as_text=True)
)
@@ -372,7 +372,7 @@ class PagureFlaskIssuesACLtests(tests.Mo
output_text,
)
self.assertIn(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket.",
output_text,
)
@@ -627,7 +627,7 @@ class PagureFlaskIssuesACLtests(tests.Mo
output_text,
)
self.assertTrue(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket.",
output_text,
)
@@ -880,7 +880,7 @@ class PagureFlaskIssuesACLtests(tests.Mo
output.get_data(as_text=True),
)
self.assertTrue(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket."
in output.get_data(as_text=True)
)
--- a/tests/test_pagure_flask_api.py
+++ b/tests/test_pagure_flask_api.py
@@ -176,7 +176,7 @@ class PagureFlaskApitests(tests.SimplePa
output = self.app.get("/api/0/-/error_codes")
self.assertEqual(output.status_code, 200)
data = json.loads(output.get_data(as_text=True))
- self.assertEqual(len(data), 46)
+ self.assertEqual(len(data), 47)
self.assertEqual(
sorted(data.keys()),
sorted(
@@ -196,6 +196,7 @@ class PagureFlaskApitests(tests.SimplePa
"EISSUENOTALLOWED",
"EMODIFYPROJECTNOTALLOWED",
"ENEWPROJECTDISABLED",
+ "ENEWPROJECTFORBIDDEN",
"ENOCODE",
"ENOCOMMENT",
"ENOCOMMIT",
--- a/tests/test_pagure_lib_git_auth.py
+++ b/tests/test_pagure_lib_git_auth.py
@@ -113,7 +113,6 @@ class PagureLibGitAuthtests(tests.Modelt
self.assertEqual(output.status_code, 200)
output_text = output.get_data(as_text=True)
self.assertIn(
- "Remote hook declined the push: "
"Denied push for ref 'refs/heads/master' for user 'pingou'",
output_text,
)
@@ -156,7 +155,6 @@ class PagureLibGitAuthtests(tests.Modelt
self.assertEqual(output.status_code, 200)
output_text = output.get_data(as_text=True)
self.assertIn(
- "Remote hook declined the push: "
"Denied push for ref 'refs/heads/master' for user 'pingou'",
output_text,
)
--- a/tests/test_pagure_flask_ui_login.py
+++ b/tests/test_pagure_flask_ui_login.py
@@ -1102,7 +1102,9 @@ class PagureFlaskLogintests(tests.Simple
in (
"http://localhost/login/",
"/login/?next=http%3A%2F%2Flocalhost%2Fsettings%2F",
+ "/login/?next=http://localhost/settings/",
"http://localhost/login/?next=http%3A%2F%2Flocalhost%2Fsettings%2F",
+ "http://localhost/login/?next=http://localhost/settings/",
)
)
# session did not expire
--- a/tests/test_pagure_flask_ui_issues_open_access.py
+++ b/tests/test_pagure_flask_ui_issues_open_access.py
@@ -213,7 +213,7 @@ class PagureFlaskIssuesOpenAccesstests(t
output_text,
)
self.assertIn(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket.",
output_text,
)
@@ -313,7 +313,7 @@ class PagureFlaskIssuesOpenAccesstests(t
output_text,
)
self.assertTrue(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket." in output_text
)
--- a/tests/test_pagure_flask_ui_issues.py
+++ b/tests/test_pagure_flask_ui_issues.py
@@ -1315,7 +1315,7 @@ class PagureFlaskIssuestests(tests.Model
output_text,
)
self.assertIn(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket.",
output_text,
)
@@ -1358,7 +1358,7 @@ class PagureFlaskIssuestests(tests.Model
output_text,
)
self.assertIn(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket.",
output_text,
)
@@ -1502,7 +1502,7 @@ class PagureFlaskIssuestests(tests.Model
output_text,
)
self.assertIn(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket.",
output_text,
)
@@ -1576,7 +1576,7 @@ class PagureFlaskIssuestests(tests.Model
output_text,
)
self.assertTrue(
- '<a href="/login/?next=http%3A%2F%2Flocalhost%2Ftest%2Fissue%2F1">'
+ '<a href="/login/?next=http://localhost/test/issue/1">'
"Log in</a>\n to comment on this ticket." in output_text
)
|