remove hardcoded passwords

This commit is contained in:
Jens Langhammer 2019-02-26 13:06:22 +01:00
parent 250b6691d4
commit b19b5b644d
3 changed files with 15 additions and 3 deletions

View file

@ -1,4 +1,6 @@
"""passbook Core Account Test""" """passbook Core Account Test"""
import string
from random import SystemRandom
from django.test import TestCase from django.test import TestCase
from django.urls import reverse from django.urls import reverse
@ -26,7 +28,9 @@ class TestAuthenticationViews(TestCase):
self.user = User.objects.create_superuser( self.user = User.objects.create_superuser(
username='unittest user', username='unittest user',
email='unittest@example.com', 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): def test_sign_up_view(self):
"""Test account.sign_up view (Anonymous)""" """Test account.sign_up view (Anonymous)"""

View file

@ -1,4 +1,7 @@
"""passbook user view tests""" """passbook user view tests"""
import string
from random import SystemRandom
from django.shortcuts import reverse from django.shortcuts import reverse
from django.test import TestCase from django.test import TestCase
@ -13,7 +16,8 @@ class TestOverviewViews(TestCase):
self.user = User.objects.create_superuser( self.user = User.objects.create_superuser(
username='unittest user', username='unittest user',
email='unittest@example.com', 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) self.client.force_login(self.user)
def test_overview(self): def test_overview(self):

View file

@ -1,4 +1,7 @@
"""passbook user view tests""" """passbook user view tests"""
import string
from random import SystemRandom
from django.shortcuts import reverse from django.shortcuts import reverse
from django.test import TestCase from django.test import TestCase
@ -14,7 +17,8 @@ class TestUserViews(TestCase):
self.user = User.objects.create_superuser( self.user = User.objects.create_superuser(
username='unittest user', username='unittest user',
email='unittest@example.com', 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) self.client.force_login(self.user)
def test_user_settings(self): def test_user_settings(self):