forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default for
redirect
param of create()
and login()
to None
Fix the following mypy error: ``` lib/tool_shed/test/functional/test_frontend_login.py:76: error: Argument "redirect" to "login" of "ShedTwillTestCase" has incompatible type "None"; expected "str" [arg-type] self.login(email, TEST_PASSWORD, username=user, redirect=None) ^ ```
- Loading branch information
Showing
2 changed files
with
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
Iterator, | ||
List, | ||
Optional, | ||
Tuple, | ||
) | ||
from urllib.parse import ( | ||
quote_plus, | ||
|
@@ -694,7 +695,14 @@ def _submit_register_form(self, email: str, password: str, username: str, redire | |
def invalid_tools_labels(self) -> str: | ||
return "Invalid Tools" if self.is_v2 else "Invalid tools" | ||
|
||
def create(self, cntrller="user", email="[email protected]", password="testuser", username="admin-user", redirect=""): | ||
def create( | ||
self, | ||
cntrller: str = "user", | ||
email: str = "[email protected]", | ||
password: str = "testuser", | ||
username: str = "admin-user", | ||
redirect: Optional[str] = None, | ||
) -> Tuple[bool, bool, bool]: | ||
# HACK: don't use panels because late_javascripts() messes up the twill browser and it | ||
# can't find form fields (and hence user can't be logged in). | ||
params = dict(cntrller=cntrller, use_panels=False) | ||
|
@@ -747,7 +755,7 @@ def login( | |
email: str = "[email protected]", | ||
password: str = "testuser", | ||
username: str = "admin-user", | ||
redirect: str = "", | ||
redirect: Optional[str] = None, | ||
logout_first: bool = True, | ||
): | ||
if self.is_v2: | ||
|
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