def test_email_is_sent_to_operators(self):
     site_conf = SiteConfiguration(
         site=Site.objects.get(pk=current_site_id()))
     site_conf._email_addr_from = '*****@*****.**'
     site_conf._email_addr_to_1 = '*****@*****.**'
     site_conf.save()
     self.form.submit('_save')
     self.assertEqual(len(mail.outbox), 1)
     email = mail.outbox[0]
     """:type : django.core.mail.EmailMessage"""
     self.assertEqual(email.subject,
                      "New ticket created by {}".format(self.user.username))
     self.assertSetEqual(set(email.to), set(site_conf.email_addrs_to))
     self.assertEqual(email.from_email, site_conf.email_addr_from)
 def test_email_is_sent_to_operators(self):
     site_conf = SiteConfiguration(
         site=Site.objects.get(pk=current_site_id()))
     site_conf._email_addr_from = '*****@*****.**'
     site_conf._email_addr_to_1 = '*****@*****.**'
     site_conf.save()
     self.form.submit('_save')
     self.assertEqual(len(mail.outbox), 1)
     email = mail.outbox[0]
     """:type : django.core.mail.EmailMessage"""
     self.assertEqual(email.subject,
                      "New ticket created by {}".format(self.user.username))
     self.assertSetEqual(set(email.to), set(site_conf.email_addrs_to))
     self.assertEqual(email.from_email, site_conf.email_addr_from)
Exemple #3
0
 def test_email_add_from_return_settings_server_email(self):
     site_conf = SiteConfiguration()
     site_conf._email_addr_from = None
     with patch('openhelpdesk.models.settings',
                SERVER_EMAIL='*****@*****.**'):
         assert site_conf.email_addr_from == '*****@*****.**'
Exemple #4
0
 def test_email_add_from_return_field_value_isnt_none(self):
     site_conf = SiteConfiguration()
     site_conf._email_addr_from = '*****@*****.**'
     assert site_conf.email_addr_from == '*****@*****.**'
 def test_email_add_from_return_settings_server_email(self):
     site_conf = SiteConfiguration()
     site_conf._email_addr_from = None
     with patch('openhelpdesk.models.settings',
                SERVER_EMAIL='*****@*****.**'):
         assert site_conf.email_addr_from == '*****@*****.**'
 def test_email_add_from_return_field_value_isnt_none(self):
     site_conf = SiteConfiguration()
     site_conf._email_addr_from = '*****@*****.**'
     assert site_conf.email_addr_from == '*****@*****.**'