manager: display last (keepalive) activity on user page (#74228)
This commit is contained in:
parent
63fa2d3f16
commit
b168ac9bcb
|
@ -61,6 +61,12 @@
|
|||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if object.keepalive %}
|
||||
<p class="a2-manager-user-last-activity">
|
||||
{% blocktrans with date=object.keepalive %}Last activity on {{ date }}.{% endblocktrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<p class="a2-manager-user-date-joined">
|
||||
{% blocktrans with date=object.date_joined %}Created on {{ date }}{% endblocktrans %}
|
||||
</p>
|
||||
|
|
|
@ -760,6 +760,12 @@ def test_detail_view(app, admin, simple_user):
|
|||
url = f'/manage/users/{simple_user.pk}/'
|
||||
resp = login(app, admin, url)
|
||||
assert str(simple_user.uuid) in resp.text
|
||||
assert "Last activity" not in resp.text
|
||||
assert not resp.pyquery('.a2-manager-user-last-activity')
|
||||
simple_user.keepalive = datetime.datetime(2023, 2, 1, 7)
|
||||
simple_user.save()
|
||||
resp = app.get(url)
|
||||
assert "Last activity on Feb. 1, 2023" in resp.pyquery('.a2-manager-user-last-activity')[0].text
|
||||
|
||||
|
||||
def test_detail_view_user_deleted(app, admin, simple_user):
|
||||
|
|
Loading…
Reference in New Issue