authentik.flows.tests.test_stage_views
stage view tests
1"""stage view tests""" 2 3from collections.abc import Callable 4 5from django.test import RequestFactory, TestCase 6 7from authentik.flows.stage import StageView 8from authentik.flows.views.executor import FlowExecutorView 9from authentik.lib.utils.reflection import all_subclasses 10 11 12class TestViews(TestCase): 13 """Generic model properties tests""" 14 15 def setUp(self) -> None: 16 self.factory = RequestFactory() 17 self.exec = FlowExecutorView(request=self.factory.get("/")) 18 19 20def view_tester_factory(view_class: type[StageView]) -> Callable: 21 """Test a form""" 22 23 def tester(self: TestViews): 24 model_class = view_class(self.exec) 25 if not hasattr(model_class, "dispatch"): 26 self.assertIsNotNone(model_class.post) 27 self.assertIsNotNone(model_class.get) 28 29 return tester 30 31 32for view in all_subclasses(StageView): 33 setattr(TestViews, f"test_view_{view.__name__}", view_tester_factory(view))
13class TestViews(TestCase): 14 """Generic model properties tests""" 15 16 def setUp(self) -> None: 17 self.factory = RequestFactory() 18 self.exec = FlowExecutorView(request=self.factory.get("/"))
Generic model properties tests
16 def setUp(self) -> None: 17 self.factory = RequestFactory() 18 self.exec = FlowExecutorView(request=self.factory.get("/"))
Hook method for setting up the test fixture before exercising it.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get)
The type of the None singleton.
21def view_tester_factory(view_class: type[StageView]) -> Callable: 22 """Test a form""" 23 24 def tester(self: TestViews): 25 model_class = view_class(self.exec) 26 if not hasattr(model_class, "dispatch"): 27 self.assertIsNotNone(model_class.post) 28 self.assertIsNotNone(model_class.get) 29 30 return tester
Test a form