Best Python code snippet using Kiwi_python
email.py
Source:email.py
1# -*- coding: utf-8 -*-2from django.conf import settings3from tcms.core.utils.mailto import mailto4def email_plan_update(plan):5 recipients = get_plan_notification_recipients(plan)6 if not recipients:7 return8 subject = u'TestPlan %s has been updated.' % plan.pk9 mailto(settings.PLAN_EMAIL_TEMPLATE, subject,10 recipients, {'plan': plan})11def get_plan_notification_recipients(plan):12 recipients = set()13 if plan.owner:14 if plan.emailing.auto_to_plan_owner:15 recipients.add(plan.owner.email)16 if plan.emailing.auto_to_plan_author:17 recipients.add(plan.author.email)18 if plan.emailing.auto_to_case_owner:...
signals.py
Source:signals.py
...4def on_plan_save(sender, instance, created=False, **kwargs):5 # email changes6 if not created:7 if instance.emailing.notify_on_plan_update:8 email.email_plan_update(instance)9def on_plan_delete(sender, instance, **kwargs):10 # email this deletion11 if instance.emailing.notify_on_plan_delete:12 email.email_plan_deletion(instance)13def pre_save_clean(sender, **kwargs):14 instance = kwargs['instance']...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!