1
0
mirror of https://github.com/ihabunek/toot synced 2024-12-23 15:37:47 +01:00

Use a stronger password in tests

gotosocial registration fails with a weak password
This commit is contained in:
Ivan Habunek 2024-04-06 13:11:33 +02:00
parent 4b17e2e586
commit bf12dbff70
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
2 changed files with 5 additions and 3 deletions

View File

@ -41,6 +41,8 @@ TRUMPET = str(Path(__file__).parent.parent.parent / "trumpet.png")
ASSETS_DIR = str(Path(__file__).parent.parent / "assets") ASSETS_DIR = str(Path(__file__).parent.parent / "assets")
PASSWORD = "83dU29170rjKilKQQwuWhJv3PKnSW59bWx0perjP6i7Nu4rkeh4mRfYuvVLYM3fM"
def create_app(base_url): def create_app(base_url):
instance = api.get_instance(base_url).json() instance = api.get_instance(base_url).json()
@ -52,7 +54,7 @@ def register_account(app: App):
username = str(uuid.uuid4())[-10:] username = str(uuid.uuid4())[-10:]
email = f"{username}@example.com" email = f"{username}@example.com"
response = api.register_account(app, username, email, "password", "en") response = api.register_account(app, username, email, PASSWORD, "en")
return User(app.instance, username, response["access_token"]) return User(app.instance, username, response["access_token"])

View File

@ -3,7 +3,7 @@ from unittest import mock
from unittest.mock import MagicMock from unittest.mock import MagicMock
from toot import User, cli from toot import User, cli
from tests.integration.conftest import Run from tests.integration.conftest import PASSWORD, Run
# TODO: figure out how to test login # TODO: figure out how to test login
@ -89,7 +89,7 @@ def test_login_cli(
cli.auth.login_cli, cli.auth.login_cli,
"--instance", "http://localhost:3000", "--instance", "http://localhost:3000",
"--email", f"{user.username}@example.com", "--email", f"{user.username}@example.com",
"--password", "password", "--password", PASSWORD,
) )
assert result.exit_code == 0 assert result.exit_code == 0
assert "✓ Successfully logged in." in result.stdout assert "✓ Successfully logged in." in result.stdout