-
-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* main: (43 commits) stages/authenticator_webauthn: Update FIDO MDS3 & Passkey aaguid blobs (#9535) web: bump the rollup group across 1 directory with 3 updates (#9532) website/developer-docs: Add note for custom YAML tags in an IDE (#9528) lifecycle: close database connection after migrating (#9516) web: bump the babel group in /web with 3 updates (#9520) core: bump node from 21 to 22 (#9521) web: bump @codemirror/lang-python from 6.1.5 to 6.1.6 in /web (#9523) providers/rac: bump guacd to 1.5.5 (#9514) core: only prefetch related objects when required (#9476) website/integrations: move Fortimanager to Networking (#9505) website: bump react-tooltip from 5.26.3 to 5.26.4 in /website (#9494) web: bump the rollup group in /web with 3 updates (#9497) web: bump yaml from 2.4.1 to 2.4.2 in /web (#9499) core: bump goauthentik.io/api/v3 from 3.2024040.1 to 3.2024041.1 (#9503) core: bump pytest from 8.1.1 to 8.2.0 (#9501) website: bump react-dom from 18.3.0 to 18.3.1 in /website (#9495) website: bump react and @types/react in /website (#9496) web: bump react-dom from 18.3.0 to 18.3.1 in /web (#9498) core: bump sentry-sdk from 2.0.0 to 2.0.1 (#9502) web/flows: fix missing fallback for flow logo (#9487) ...
- Loading branch information
Showing
76 changed files
with
916 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""authentik event models tests""" | ||
|
||
from collections.abc import Callable | ||
|
||
from django.db.models import Model | ||
from django.test import TestCase | ||
|
||
from authentik.core.models import default_token_key | ||
from authentik.lib.utils.reflection import get_apps | ||
|
||
|
||
class TestModels(TestCase): | ||
"""Test Models""" | ||
|
||
|
||
def model_tester_factory(test_model: type[Model]) -> Callable: | ||
"""Test models' __str__ and __repr__""" | ||
|
||
def tester(self: TestModels): | ||
allowed = 0 | ||
# Token-like objects need to lookup the current tenant to get the default token length | ||
for field in test_model._meta.fields: | ||
if field.default == default_token_key: | ||
allowed += 1 | ||
with self.assertNumQueries(allowed): | ||
str(test_model()) | ||
with self.assertNumQueries(allowed): | ||
repr(test_model()) | ||
|
||
return tester | ||
|
||
|
||
for app in get_apps(): | ||
for model in app.get_models(): | ||
setattr(TestModels, f"test_{app.label}_{model.__name__}", model_tester_factory(model)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.