authentik.events.tests.test_models

authentik event models tests

 1"""authentik event models tests"""
 2
 3from collections.abc import Callable
 4
 5from django.db.models import Model
 6from django.test import TestCase
 7
 8from authentik.core.models import default_token_key
 9from authentik.events.models import default_event_duration
10from authentik.lib.utils.reflection import get_apps
11
12
13class TestModels(TestCase):
14    """Test Models"""
15
16
17def model_tester_factory(test_model: type[Model]) -> Callable:
18    """Test models' __str__ and __repr__"""
19
20    def tester(self: TestModels):
21        allowed = 0
22        # Token-like objects need to lookup the current tenant to get the default token length
23        for field in test_model._meta.fields:
24            if field.default in [default_token_key, default_event_duration]:
25                allowed += 1
26        with self.assertNumQueries(allowed):
27            str(test_model())
28        with self.assertNumQueries(allowed):
29            repr(test_model())
30
31    return tester
32
33
34for app in get_apps():
35    for model in app.get_models():
36        setattr(TestModels, f"test_{app.label}_{model.__name__}", model_tester_factory(model))
class TestModels(django.test.testcases.TestCase):
14class TestModels(TestCase):
15    """Test Models"""

Test Models

def test_authentik_tenants_Tenant(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_tenants_Domain(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_tasks_Task(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_tasks_TaskLog(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_tasks_WorkerStatus(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_admin_VersionHistory(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_Group(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_GroupParentageNode(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_GroupAncestryNode(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_User(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_Provider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_Application(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_ApplicationEntitlement(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_Source(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_UserSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_GroupSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_Token(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_PropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_Session(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_AuthenticatedSession(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_core_ProxySource(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_crypto_CertificateKeyPair(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_Device(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_DeviceUserBinding(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_DeviceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_DeviceFactSnapshot(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_Connector(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_DeviceAccessGroup(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_EndpointStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_agent_AgentConnector(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_agent_AgentDeviceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_agent_AgentDeviceUserBinding(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_agent_DeviceToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_agent_EnrollmentToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_agent_DeviceAuthenticationToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_agent_AppleNonce(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_enterprise_License(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_enterprise_LicenseUsage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_events_Event(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_events_NotificationTransport(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_events_Notification(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_events_NotificationRule(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_events_NotificationWebhookMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_flows_Stage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_flows_Flow(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_flows_FlowStageBinding(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_flows_FlowToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_outposts_OutpostServiceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_outposts_DockerServiceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_outposts_KubernetesServiceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_outposts_Outpost(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_dummy_DummyPolicy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_event_matcher_EventMatcherPolicy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_expiry_PasswordExpiryPolicy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_expression_ExpressionPolicy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_geoip_GeoIPPolicy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_password_PasswordPolicy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_reputation_ReputationPolicy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_reputation_Reputation(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_PolicyBindingModel(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_PolicyBinding(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_Policy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_ldap_LDAPProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_oauth2_ScopeMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_oauth2_OAuth2Provider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_oauth2_AuthorizationCode(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_oauth2_AccessToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_oauth2_RefreshToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_oauth2_DeviceToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_proxy_ProxySession(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_proxy_ProxyProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_rac_RACProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_rac_Endpoint(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_rac_RACPropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_rac_ConnectionToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_radius_RadiusProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_radius_RadiusProviderPropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_saml_SAMLProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_saml_SAMLPropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_saml_SAMLSession(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_scim_SCIMProviderUser(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_scim_SCIMProviderGroup(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_scim_SCIMProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_scim_SCIMMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_rbac_Role(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_rbac_InitialPermissions(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_rbac_SystemPermission(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_kerberos_KerberosSource(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_kerberos_KerberosSourcePropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_kerberos_UserKerberosSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_kerberos_GroupKerberosSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_ldap_LDAPSource(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_ldap_LDAPSourcePropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_ldap_UserLDAPSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_ldap_GroupLDAPSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_oauth_OAuthSource(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_oauth_OAuthSourcePropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_oauth_UserOAuthSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_oauth_GroupOAuthSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_plex_PlexSource(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_plex_PlexSourcePropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_plex_UserPlexSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_plex_GroupPlexSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_saml_SAMLSource(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_saml_SAMLSourcePropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_saml_UserSAMLSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_saml_GroupSAMLSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_scim_SCIMSource(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_scim_SCIMSourcePropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_scim_SCIMSourceUser(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_scim_SCIMSourceGroup(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_telegram_TelegramSource(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_telegram_TelegramSourcePropertyMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_telegram_UserTelegramSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_sources_telegram_GroupTelegramSourceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_duo_AuthenticatorDuoStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_duo_DuoDevice(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_email_AuthenticatorEmailStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_email_EmailDevice(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_sms_AuthenticatorSMSStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_sms_SMSDevice(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_static_AuthenticatorStaticStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_static_StaticDevice(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_static_StaticToken(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_totp_AuthenticatorTOTPStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_totp_TOTPDevice(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_validate_AuthenticatorValidateStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_webauthn_AuthenticatorWebAuthnStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_webauthn_WebAuthnDevice(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_webauthn_WebAuthnDeviceType(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_captcha_CaptchaStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_deny_DenyStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_dummy_DummyStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_email_EmailStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_identification_IdentificationStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_invitation_InvitationStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_invitation_Invitation(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_password_PasswordStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_prompt_Prompt(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_prompt_PromptStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_redirect_RedirectStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_user_delete_UserDeleteStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_user_login_UserLoginStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_user_logout_UserLogoutStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_user_write_UserWriteStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_tasks_schedules_Schedule(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_brands_Brand(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_blueprints_BlueprintInstance(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_fleet_FleetConnector(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_endpoints_connectors_google_chrome_GoogleChromeConnector(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_lifecycle_LifecycleRule(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_lifecycle_LifecycleIteration(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_lifecycle_Review(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_unique_password_UniquePasswordPolicy(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_policies_unique_password_UserPasswordHistory(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_google_workspace_GoogleWorkspaceProviderUser(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_google_workspace_GoogleWorkspaceProviderGroup(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_google_workspace_GoogleWorkspaceProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_google_workspace_GoogleWorkspaceProviderMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_microsoft_entra_MicrosoftEntraProviderUser(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_microsoft_entra_MicrosoftEntraProviderGroup(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_microsoft_entra_MicrosoftEntraProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_microsoft_entra_MicrosoftEntraProviderMapping(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_ssf_SSFProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_ssf_Stream(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_ssf_StreamEvent(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_providers_ws_federation_WSFederationProvider(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_reports_DataExport(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_endpoint_gdtc_AuthenticatorEndpointGDTCStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_endpoint_gdtc_EndpointDevice(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_authenticator_endpoint_gdtc_EndpointDeviceConnection(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_mtls_MutualTLSStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def test_authentik_stages_source_SourceStage(self: TestModels):
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())

The type of the None singleton.

def model_tester_factory(test_model: type[django.db.models.base.Model]) -> Callable:
18def model_tester_factory(test_model: type[Model]) -> Callable:
19    """Test models' __str__ and __repr__"""
20
21    def tester(self: TestModels):
22        allowed = 0
23        # Token-like objects need to lookup the current tenant to get the default token length
24        for field in test_model._meta.fields:
25            if field.default in [default_token_key, default_event_duration]:
26                allowed += 1
27        with self.assertNumQueries(allowed):
28            str(test_model())
29        with self.assertNumQueries(allowed):
30            repr(test_model())
31
32    return tester

Test models' __str__ and __repr__