def send_create_reservation_to_customer(customer_pok): customer = User.objects.get(pk=customer_pok) send_kwargs, ctx = get_email_context() ctx["customer"] = build_absolute_uri(reverse("dashboard:index")) send_templated_mail( template_name="reservation/customer_create_reservation", recipient_list=[customer.email], context=ctx, **send_kwargs, )
def test_get_email_context(site_settings): site = site_settings.site expected_send_kwargs = {"from_email": site_settings.default_from_email} proper_context = { "domain": site.domain, "site_name": site.name, } send_kwargs, received_context = get_email_context() assert send_kwargs == expected_send_kwargs assert proper_context == received_context
def test_get_email_context(site_settings): site = site_settings.site logo_url = build_absolute_uri(static("images/logo-light.svg")) expected_send_kwargs = {"from_email": site_settings.default_from_email} proper_context = { "domain": site.domain, "logo_url": logo_url, "site_name": site.name, } send_kwargs, received_context = get_email_context() assert send_kwargs == expected_send_kwargs assert proper_context == received_context