-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into web/enhance/search-select
* main: (36 commits) 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) events: ensure all models' __str__ can be called without any further lookups (#9480) core, web: update translations (#9482) flows: fix execute API endpoint (#9478) sources/oauth: fix OAuth Client sending token request incorrectly (#9474) web: bump API Client version (#9473) release: 2024.4.1 website/docs: update release notes for 2024.4.1 again (#9471) ...
- Loading branch information
Showing
71 changed files
with
759 additions
and
214 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
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
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.