-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ def test_load_user(self): | |
|
||
with self.app.test_request_context(): | ||
user = create_user(email='[email protected]', password='password') | ||
self.assertEqual(user, db.session.query(User).get(user.id)) | ||
assert user == db.session.query(User).get(user.id) | ||
|
||
def test_verified_user(self): | ||
"""Method to test if user is verified""" | ||
|
@@ -24,7 +24,7 @@ def test_verified_user(self): | |
user = create_user(email='[email protected]', password='password') | ||
user.is_verified = False | ||
login_user(user) | ||
self.assertEqual(AuthManager.is_verified_user(), False) | ||
assert AuthManager.is_verified_user() == False | ||
|
||
def test_is_accessible(self): | ||
"""Method to test if user is accessible(authenticated)""" | ||
|
@@ -33,7 +33,7 @@ def test_is_accessible(self): | |
user = create_user(email='[email protected]', password='password') | ||
login_user(user) | ||
logout_user() | ||
self.assertEqual(AuthManager.is_accessible(), False) | ||
assert AuthManager.is_accessible() == False | ||
|
||
def test_check_auth_admin(self): | ||
"""Method to test proper authentication & admin rights for a user""" | ||
|
@@ -42,12 +42,12 @@ def test_check_auth_admin(self): | |
user = create_user(email='[email protected]', password='password') | ||
user.is_admin = True | ||
status = AuthManager.check_auth_admin('[email protected]', 'password') | ||
self.assertEqual(True, status) | ||
assert True == status | ||
|
||
user = create_user(email='[email protected]', password='password') | ||
user.is_admin = False | ||
status = AuthManager.check_auth_admin('[email protected]', 'password') | ||
self.assertEqual(False, status) | ||
assert False == status | ||
|
||
|
||
if __name__ == '__main__': | ||
|