Exemplo n.º 1
0
class UserModelTest(unittest.TestCase):
    def setUp(self):
        self.new_user = User(password='******')

    def test_password_setter(self):
        self.assertTrue(self.new_user.pass_secure is not None)

    def test_no_access_password(self):
        with self.assertRaises(AttributeError):
            self.new_user.password

    def test_password_verification(self):
        self.assertTrue(self.new_user.verify_password('banana'))
Exemplo n.º 2
0
class TestUserModel(unittest.TestCase):
    def setUp(self):
        self.user = User(password="******")

    def test_password_setter(self):
        self.assertTrue(self.user.password_hash is not None)

    def test_no_access_password(self):
        with self.assertRaises(AttributeError):
            self.user.password

    def test_password_verification(self):
        self.assertTrue(self.user.verify_password('1234'))