def test_controller_logoff_clears_user(): clear_expectations() clear() ctrl = Controller() ctrl.login("some_random_user") ctrl.logoff() assert not ctrl.user
def test_controller_can_authenticate_user(): clear_expectations() clear() ctrl = Controller() ctrl.login(user="******") assert ctrl.user == "auth_user"