From 0b6d8699022e2b30b34332970fd4ce6538212c00 Mon Sep 17 00:00:00 2001 From: Johnny Date: Mon, 22 Oct 2018 22:26:29 +0000 Subject: [PATCH] Fixes failed tests, hopefully for real this time. --- evennia/accounts/tests.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/evennia/accounts/tests.py b/evennia/accounts/tests.py index 2cfd9350cb..5e8e58cf9f 100644 --- a/evennia/accounts/tests.py +++ b/evennia/accounts/tests.py @@ -111,8 +111,9 @@ class TestDefaultAccountAuth(EvenniaTest): self.assertTrue(account, 'New account should have been created.') # Try creating a duplicate account - account, errors = DefaultAccount.create(username='Ziggy', password='starman11') - self.assertFalse(account, 'Duplicate account name should not have been allowed.') + account2, errors = DefaultAccount.create(username='Ziggy', password='starman11') + self.assertFalse(account2, 'Duplicate account name should not have been allowed.') + account.delete() def test_throttle(self): "Confirm throttle activates on too many failures." @@ -147,10 +148,11 @@ class TestDefaultAccountAuth(EvenniaTest): "Check validators allow sufficiently complex passwords" for better in ('Mxyzptlk', "j0hn, i'M 0n1y d4nc1nG"): self.assertTrue(account.validate_password(better, account=self.account)[0]) + account.delete() def test_password_change(self): "Check password setting and validation is working as expected" - account = create.create_account("TestAccount%s" % randint(0, 9), + account = create.create_account("TestAccount%s" % randint(100000, 999999), email="test@test.com", password="testpassword", typeclass=DefaultAccount) from django.core.exceptions import ValidationError @@ -160,6 +162,7 @@ class TestDefaultAccountAuth(EvenniaTest): # Try setting a better password (test for False; returns None on success) self.assertFalse(account.set_password('Mxyzptlk')) + account.delete() class TestDefaultAccount(TestCase): "Check DefaultAccount class"