0001-manager-display-last-keepalive-activity-on-user-page.patch
src/authentic2/manager/templates/authentic2/manager/user_detail.html | ||
---|---|---|
61 | 61 |
{% endif %} |
62 | 62 |
</p> |
63 | 63 | |
64 |
{% if object.keepalive %} |
|
65 |
<p class="a2-manager-user-last-activity"> |
|
66 |
{% blocktrans with date=object.keepalive %}Last activity on {{ date }}.{% endblocktrans %} |
|
67 |
</p> |
|
68 |
{% endif %} |
|
69 | ||
64 | 70 |
<p class="a2-manager-user-date-joined"> |
65 | 71 |
{% blocktrans with date=object.date_joined %}Created on {{ date }}{% endblocktrans %} |
66 | 72 |
</p> |
tests/test_user_manager.py | ||
---|---|---|
760 | 760 |
url = f'/manage/users/{simple_user.pk}/' |
761 | 761 |
resp = login(app, admin, url) |
762 | 762 |
assert str(simple_user.uuid) in resp.text |
763 |
assert "Last activity" not in resp.text |
|
764 |
assert not resp.pyquery('.a2-manager-user-last-activity') |
|
765 |
simple_user.keepalive = datetime.datetime(2023, 2, 1, 7) |
|
766 |
simple_user.save() |
|
767 |
resp = app.get(url) |
|
768 |
assert "Last activity on Feb. 1, 2023" in resp.pyquery('.a2-manager-user-last-activity')[0].text |
|
763 | 769 | |
764 | 770 | |
765 | 771 |
def test_detail_view_user_deleted(app, admin, simple_user): |
766 |
- |