-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #594 from mishaschwartz/allow-case-sensitive-regex…
…-matches
- Loading branch information
Showing
5 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -489,6 +489,25 @@ def test_PostUsers_WithExtraRegex_InvalidExtraRegex(self): | |
headers=self.json_headers, cookies=self.cookies, expect_errors=True) | ||
utils.check_response_basic_info(resp, 400, expected_method="POST") | ||
|
||
@runner.MAGPIE_TEST_USERS | ||
def test_PostUsers_WithExtraRegex_CaseInvalidExtraRegex(self): | ||
""" | ||
Check that the user_name_extra_regex setting is used to validate a new user name when the user name is | ||
invalid according to that regex because the case is incorrect but is valid according to the ax.PARAM_REGEX. | ||
.. versionchanged:: 3.37.1 | ||
""" | ||
utils.warn_version(self, "case sensitive user name extra regex", "3.37.1", skip=True) | ||
with utils.mocked_get_settings(settings={"magpie.user_name_extra_regex": "^[a-z]+$"}): | ||
data = { | ||
"user_name": "UpperCaseUserName", | ||
"password": self.test_user_name, | ||
"email": "[email protected]", | ||
} | ||
resp = utils.test_request(self, "POST", "/users", data=data, | ||
headers=self.json_headers, cookies=self.cookies, expect_errors=True) | ||
utils.check_response_basic_info(resp, 400, expected_method="POST") | ||
|
||
@runner.MAGPIE_TEST_USERS | ||
def test_PostUsers_WithExtraRegex_InvalidRegex(self): | ||
""" | ||
|