def mock_auth(email, password, active=True): h = "$2b$12$lqzxUnknwA/BYMJo2hFq5OBkkxsXP/7bupeNhizTFVa9WHaMOY6de" ph = "bcrypt||" + h account = Account() account.first_name = "Example" account.last_name = "User" account.email = '*****@*****.**' account.account_type = "senior_admin" account.password = ph if active is True: account.status = 'active' else: account.status = 'inactive' account.load_domains = MagicMock(return_value=None) vegadns.api.common.Auth.get_account_by_email = MagicMock( return_value=account)