jedcunningham commented on code in PR #23314:
URL: https://github.com/apache/airflow/pull/23314#discussion_r861220142
##########
tests/www/test_security.py:
##########
@@ -814,3 +816,68 @@ def test_fab_models_use_airflow_base_meta():
# TODO: move this test to appropriate place when we have more tests for
FAB models
user = User()
assert user.metadata is Base.metadata
+
+
[email protected]()
+def mock_security_manager(app_builder):
+ mocked_security_manager = MockSecurityManager(appbuilder=app_builder)
+ mocked_security_manager.update_user = mock.MagicMock()
+ return mocked_security_manager
+
+
[email protected]()
+def new_user():
+ user = mock.MagicMock()
+ user.login_count = None
+ user.fail_login_count = None
+ user.last_login = None
+ return user
+
+
[email protected]()
+def old_user():
+ user = mock.MagicMock()
+ user.login_count = 42
+ user.fail_login_count = 9
+ user.last_login = datetime.datetime(1984, 12, 1, 0, 0, 0)
Review Comment:
Dang, really going back in time here :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]