From 2fa3b7134661deb201b1a9a9a907f0a8051640be Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sat, 24 Oct 2020 16:05:57 +0100 Subject: Contact history for person page added but doesn't filter private events out yet --- ctrack/organisations/tests/test_views.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'ctrack/organisations/tests') diff --git a/ctrack/organisations/tests/test_views.py b/ctrack/organisations/tests/test_views.py index c939894..c1eb3ef 100644 --- a/ctrack/organisations/tests/test_views.py +++ b/ctrack/organisations/tests/test_views.py @@ -16,6 +16,27 @@ from ..views import OrganisationListView pytestmark = pytest.mark.django_db +def test_person_history_view(user, client, org_with_people): + person = org_with_people.person_set.first() + e1 = SingleDateTimeEventFactory.create( + type_descriptor="MEETING", short_description="First Meeting" + ) + e2 = SingleDateTimeEventFactory.create( + type_descriptor="MEETING", short_description="Second Meeting" + ) + e1.participants.add(person) + e1.save() + e2.participants.add(person) + e2.save() + client.force_login(user) + response = client.get( + reverse("organisations:person_contact_history", kwargs={"person_id": person.pk}) + ) + assert response.status_code == 200 + html = response.content.decode("utf-8") + assert "First Meeting" in html + + def test_organisation_by_inspector_view(inspector1, inspector2, client, submode): org = OrganisationFactory(submode=submode, lead_inspector=inspector1, deputy_lead_inspector=inspector2) client.force_login(inspector1) -- cgit v1.2.3