mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Have permissions decorators check user signed in
Rather than force us to write the decorators in a specific order let’s just have one decorator call the other. This should make fewer lines of code, and fewer annoying test failures. It also means that the same way of raising a `401` (through the `current_app` method) is used everywhere.
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
import pytest
|
||||
|
||||
from app.models.user import User
|
||||
from app.models.user import AnonymousUser, User
|
||||
|
||||
|
||||
def test_anonymous_user(app_):
|
||||
assert AnonymousUser().is_authenticated is False
|
||||
assert AnonymousUser().logged_in_elsewhere() is False
|
||||
assert AnonymousUser().default_organisation.name is None
|
||||
assert AnonymousUser().default_organisation.crown is None
|
||||
assert AnonymousUser().default_organisation.agreement_signed is None
|
||||
assert AnonymousUser().default_organisation.domains == []
|
||||
assert AnonymousUser().default_organisation.organisation_type is None
|
||||
assert AnonymousUser().default_organisation.request_to_go_live_notes is None
|
||||
|
||||
|
||||
def test_user(app_):
|
||||
|
||||
Reference in New Issue
Block a user