mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-27 16:10:11 +08:00
29 lines
656 B
Python
29 lines
656 B
Python
# -*- coding: utf-8 -*-
|
|
"""
|
|
test_trackable
|
|
~~~~~~~~~~~~~~
|
|
|
|
Trackable tests
|
|
"""
|
|
|
|
import pytest
|
|
|
|
from utils import authenticate, logout
|
|
|
|
pytestmark = pytest.mark.trackable()
|
|
|
|
|
|
def test_trackable_flag(app, client):
|
|
e = 'matt@lp.com'
|
|
authenticate(client, email=e)
|
|
logout(client)
|
|
authenticate(client, email=e)
|
|
|
|
with app.app_context():
|
|
user = app.security.datastore.find_user(email=e)
|
|
assert user.last_login_at is not None
|
|
assert user.current_login_at is not None
|
|
assert user.last_login_ip == 'untrackable'
|
|
assert user.current_login_ip == 'untrackable'
|
|
assert user.login_count == 2
|