@@ -67,3 +67,29 @@ def test_primary_admin_skips_deactivated_and_deleted_founders(local_db):
|
||||
for uid, _, _, _ in seeded:
|
||||
users.delete(uid=uid)
|
||||
invalidate_admins_cache()
|
||||
|
||||
|
||||
def test_account_with_a_null_is_active_counts_as_active(local_db):
|
||||
from devplacepy.database import is_account_active
|
||||
|
||||
assert is_account_active({"is_active": None}) is True
|
||||
|
||||
|
||||
def test_account_without_an_is_active_column_counts_as_active(local_db):
|
||||
from devplacepy.database import is_account_active
|
||||
|
||||
assert is_account_active({}) is True
|
||||
|
||||
|
||||
def test_an_explicitly_disabled_account_is_not_active(local_db):
|
||||
from devplacepy.database import is_account_active
|
||||
|
||||
assert is_account_active({"is_active": False}) is False
|
||||
assert is_account_active({"is_active": 0}) is False
|
||||
|
||||
|
||||
def test_an_enabled_account_is_active(local_db):
|
||||
from devplacepy.database import is_account_active
|
||||
|
||||
assert is_account_active({"is_active": True}) is True
|
||||
assert is_account_active({"is_active": 1}) is True
|
||||
|
||||
Reference in New Issue
Block a user