From b19b5b644d4e61536d3584e2181e303cd662061e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 26 Feb 2019 13:06:22 +0100 Subject: [PATCH] remove hardcoded passwords --- passbook/core/tests/test_views_authentication.py | 6 +++++- passbook/core/tests/test_views_overview.py | 6 +++++- passbook/core/tests/test_views_user.py | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/passbook/core/tests/test_views_authentication.py b/passbook/core/tests/test_views_authentication.py index 5b8ad3dcb..abd95170e 100644 --- a/passbook/core/tests/test_views_authentication.py +++ b/passbook/core/tests/test_views_authentication.py @@ -1,4 +1,6 @@ """passbook Core Account Test""" +import string +from random import SystemRandom from django.test import TestCase from django.urls import reverse @@ -26,7 +28,9 @@ class TestAuthenticationViews(TestCase): self.user = User.objects.create_superuser( username='unittest user', email='unittest@example.com', - password='test123') + password=''.join(SystemRandom().choice( + string.ascii_uppercase + string.digits) for _ in range(8))) + def test_sign_up_view(self): """Test account.sign_up view (Anonymous)""" diff --git a/passbook/core/tests/test_views_overview.py b/passbook/core/tests/test_views_overview.py index 4bfb6fa9a..0cacfbcfd 100644 --- a/passbook/core/tests/test_views_overview.py +++ b/passbook/core/tests/test_views_overview.py @@ -1,4 +1,7 @@ """passbook user view tests""" +import string +from random import SystemRandom + from django.shortcuts import reverse from django.test import TestCase @@ -13,7 +16,8 @@ class TestOverviewViews(TestCase): self.user = User.objects.create_superuser( username='unittest user', email='unittest@example.com', - password='test123') + password=''.join(SystemRandom().choice( + string.ascii_uppercase + string.digits) for _ in range(8))) self.client.force_login(self.user) def test_overview(self): diff --git a/passbook/core/tests/test_views_user.py b/passbook/core/tests/test_views_user.py index 8c17fe2c4..4bba5fa78 100644 --- a/passbook/core/tests/test_views_user.py +++ b/passbook/core/tests/test_views_user.py @@ -1,4 +1,7 @@ """passbook user view tests""" +import string +from random import SystemRandom + from django.shortcuts import reverse from django.test import TestCase @@ -14,7 +17,8 @@ class TestUserViews(TestCase): self.user = User.objects.create_superuser( username='unittest user', email='unittest@example.com', - password='test123') + password=''.join(SystemRandom().choice( + string.ascii_uppercase + string.digits) for _ in range(8))) self.client.force_login(self.user) def test_user_settings(self):