Fixes failing tests.
This commit is contained in:
parent
030a83bf9c
commit
8e1c7fadce
1 changed files with 13 additions and 11 deletions
|
|
@ -85,15 +85,13 @@ class TestDefaultGuest(EvenniaTest):
|
||||||
|
|
||||||
settings.GUEST_ENABLED = False
|
settings.GUEST_ENABLED = False
|
||||||
|
|
||||||
class TestDefaultAccount(EvenniaTest):
|
class TestDefaultAccountAuth(EvenniaTest):
|
||||||
"Check DefaultAccount class"
|
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.s1 = MagicMock()
|
super(TestDefaultAccountAuth, self).setUp()
|
||||||
self.s1.puppet = None
|
|
||||||
self.s1.sessid = 0
|
|
||||||
|
|
||||||
self.password = "testpassword"
|
self.password = "testpassword"
|
||||||
|
self.account.delete()
|
||||||
self.account = create.create_account("TestAccount%s" % randint(100000, 999999), email="test@test.com", password=self.password, typeclass=DefaultAccount)
|
self.account = create.create_account("TestAccount%s" % randint(100000, 999999), email="test@test.com", password=self.password, typeclass=DefaultAccount)
|
||||||
|
|
||||||
def test_authentication(self):
|
def test_authentication(self):
|
||||||
|
|
@ -138,10 +136,6 @@ class TestDefaultAccount(EvenniaTest):
|
||||||
result, error = DefaultAccount.validate_username('xx')
|
result, error = DefaultAccount.validate_username('xx')
|
||||||
self.assertFalse(result, "2-character username passed validation.")
|
self.assertFalse(result, "2-character username passed validation.")
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
if hasattr(self, "account"):
|
|
||||||
self.account.delete()
|
|
||||||
|
|
||||||
def test_password_validation(self):
|
def test_password_validation(self):
|
||||||
"Check password validators deny bad passwords"
|
"Check password validators deny bad passwords"
|
||||||
|
|
||||||
|
|
@ -167,6 +161,14 @@ class TestDefaultAccount(EvenniaTest):
|
||||||
# Try setting a better password (test for False; returns None on success)
|
# Try setting a better password (test for False; returns None on success)
|
||||||
self.assertFalse(self.account.set_password('Mxyzptlk'))
|
self.assertFalse(self.account.set_password('Mxyzptlk'))
|
||||||
|
|
||||||
|
class TestDefaultAccount(TestCase):
|
||||||
|
"Check DefaultAccount class"
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.s1 = MagicMock()
|
||||||
|
self.s1.puppet = None
|
||||||
|
self.s1.sessid = 0
|
||||||
|
|
||||||
def test_puppet_object_no_object(self):
|
def test_puppet_object_no_object(self):
|
||||||
"Check puppet_object method called with no object param"
|
"Check puppet_object method called with no object param"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue