| |
@@ -2916,14 +2916,14 @@
|
| |
)
|
| |
self.assertEqual(output.status_code, 400)
|
| |
data = json.loads(output.get_data(as_text=True))
|
| |
- self.assertEqual(
|
| |
- data,
|
| |
- {
|
| |
- "errors": {"status": ["Not a valid choice"]},
|
| |
- "error_code": "EINVALIDREQ",
|
| |
- "error": "Invalid or incomplete input submitted",
|
| |
- },
|
| |
- )
|
| |
+ expected_output = {
|
| |
+ "error": "Invalid or incomplete input submitted",
|
| |
+ "error_code": "EINVALIDREQ",
|
| |
+ "errors": {"status": ["Not a valid choice"]},
|
| |
+ }
|
| |
+ if self.get_wtforms_version() >= (3, 0):
|
| |
+ expected_output["errors"]["status"] = ["Not a valid choice."]
|
| |
+ self.assertDictEqual(data, expected_output)
|
| |
|
| |
def test_flag_commit_with_uid(self):
|
| |
"""Test flagging a commit with provided uid."""
|
| |
@@ -3368,14 +3368,14 @@
|
| |
)
|
| |
self.assertEqual(output.status_code, 400)
|
| |
data = json.loads(output.get_data(as_text=True))
|
| |
- self.assertEqual(
|
| |
- data,
|
| |
- {
|
| |
- "errors": {"status": ["Not a valid choice"]},
|
| |
- "error_code": "EINVALIDREQ",
|
| |
- "error": "Invalid or incomplete input submitted",
|
| |
- },
|
| |
- )
|
| |
+ expected_output = {
|
| |
+ "error": "Invalid or incomplete input submitted",
|
| |
+ "error_code": "EINVALIDREQ",
|
| |
+ "errors": {"status": ["Not a valid choice"]},
|
| |
+ }
|
| |
+ if self.get_wtforms_version() >= (3, 0):
|
| |
+ expected_output["errors"]["status"] = ["Not a valid choice."]
|
| |
+ self.assertDictEqual(data, expected_output)
|
| |
|
| |
def test_commit_flags(self):
|
| |
"""Test retrieving commit flags."""
|
| |
@@ -3607,7 +3607,9 @@
|
| |
"error_code": "EINVALIDREQ",
|
| |
"errors": {"acl": ["Not a valid choice"]},
|
| |
}
|
| |
- self.assertEqual(data, expected_output)
|
| |
+ if self.get_wtforms_version() >= (3, 0):
|
| |
+ expected_output["errors"]["acl"] = ["Not a valid choice."]
|
| |
+ self.assertDictEqual(data, expected_output)
|
| |
|
| |
def test_api_modify_acls_user(self):
|
| |
"""Test the api_modify_acls method of the flask api for
|
| |
@@ -5664,14 +5666,14 @@
|
| |
output = self.app.post("/api/0/new/", data=data, headers=headers)
|
| |
self.assertEqual(output.status_code, 400)
|
| |
data = json.loads(output.get_data(as_text=True))
|
| |
- self.assertDictEqual(
|
| |
- data,
|
| |
- {
|
| |
- "error": "Invalid or incomplete input submitted",
|
| |
- "error_code": "EINVALIDREQ",
|
| |
- "errors": {"namespace": ["Not a valid choice"]},
|
| |
- },
|
| |
- )
|
| |
+ expected_output = {
|
| |
+ "error": "Invalid or incomplete input submitted",
|
| |
+ "error_code": "EINVALIDREQ",
|
| |
+ "errors": {"namespace": ["Not a valid choice"]},
|
| |
+ }
|
| |
+ if self.get_wtforms_version() >= (3, 0):
|
| |
+ expected_output["errors"]["namespace"] = ["Not a valid choice."]
|
| |
+ self.assertDictEqual(data, expected_output)
|
| |
|
| |
data = {
|
| |
"name": "test_42",
|
| |
The unit tests causing a lot of trouble right now and producing a lot of errors, most of the time unrelated to the actual change.
This PR tries to get to a state where we can again rely on them and focus on bug fixes and improvements.