From fed4b3157f25f65ccdaa5fd41463995a080d4673 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 18 Oct 2020 14:50:00 +0100 Subject: nice links from org detail page to specific types of simple event --- ctrack/register/tests/test_views.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'ctrack/register/tests/test_views.py') diff --git a/ctrack/register/tests/test_views.py b/ctrack/register/tests/test_views.py index 5f7ca35..0f5575d 100644 --- a/ctrack/register/tests/test_views.py +++ b/ctrack/register/tests/test_views.py @@ -127,13 +127,26 @@ class TestSingleDateTimeEvent: def test_org_passed_as_kwarg(self, user, org, request_factory): slug = org.slug view = SingleDateTimeEventCreate() - url = f"/register/event/create-simple-event-from-org/{slug}" + url = reverse("register:event_create_simple_event_from_org", args=[slug]) request = request_factory.get(url) request.user = user view.request = request view.setup(request) assert "org_slug" in view.get_form_kwargs() + def test_meeting_type_and_org_passed_as_kwarg( + self, user, org, request_factory + ): + event_type = "PHONE_CALL" + slug = org.slug + view = SingleDateTimeEventCreate() + url = reverse("register:event_create_simple_event_from_org_with_type", args=[slug, event_type]) + request = request_factory.get(url) + request.user = user + view.request = request + view.setup(request) + assert "event_type" in view.get_form_kwargs() + class TestSingleDateCAFEventViews: def test_initial_caf_received(self, client): -- cgit v1.2.3