本文整理汇总了Python中mysearches.tests.factories.SavedSearchFactory.send_update_email方法的典型用法代码示例。如果您正苦于以下问题:Python SavedSearchFactory.send_update_email方法的具体用法?Python SavedSearchFactory.send_update_email怎么用?Python SavedSearchFactory.send_update_email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysearches.tests.factories.SavedSearchFactory
的用法示例。
在下文中一共展示了SavedSearchFactory.send_update_email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_send_update_email
# 需要导入模块: from mysearches.tests.factories import SavedSearchFactory [as 别名]
# 或者: from mysearches.tests.factories.SavedSearchFactory import send_update_email [as 别名]
def test_send_update_email(self):
search = SavedSearchFactory(user=self.user, is_active=False,
url='www.my.jobs/search?q=new+search')
search.send_update_email('Your search is updated')
self.assertEqual(len(mail.outbox), 1)
email = mail.outbox.pop()
self.assertEqual(email.from_email, settings.SAVED_SEARCH_EMAIL)
self.assertEqual(email.to, [self.user.email])
self.assertEqual("My.jobs Saved Search Updated" in email.subject, True)
self.assertTrue("table" in email.body)
self.assertTrue("Your search is updated" in email.body)
self.assertTrue(email.to[0] in email.body)
示例2: test_send_update_email
# 需要导入模块: from mysearches.tests.factories import SavedSearchFactory [as 别名]
# 或者: from mysearches.tests.factories.SavedSearchFactory import send_update_email [as 别名]
def test_send_update_email(self):
search = SavedSearchFactory(user=self.user, is_active=False,
url='www.my.jobs/search?q=new+search')
search.send_update_email('Your search is updated')
self.assertEqual(len(mail.outbox), 1)
log = SavedSearchLog.objects.get()
self.assertTrue('Jobs are not sent' in log.reason)
self.assertTrue(log.was_sent)
email = mail.outbox.pop()
self.assertEqual(email.from_email, 'My.jobs Saved Search <[email protected]>')
self.assertEqual(email.to, [self.user.email])
self.assertEqual("My.jobs Saved Search Updated" in email.subject, True)
self.assertTrue("table" in email.body)
self.assertTrue("Your search is updated" in email.body)
self.assertTrue(email.to[0] in email.body)