예제 #1
0
파일: tests.py 프로젝트: D0han/saleor
 def test_sending_email_without_html(self):
     """Html content is not attached when html block is missing"""
     self.render_mock.return_value = {SUBJECT: sentinel.subject,
                                      TEXT: sentinel.text}
     send_email(address=sentinel.address,
                template_name=sentinel.template_name,
                context=sentinel.context)
     self.assert_email_constructed()
     self.email_mock().send.assert_called_once()
예제 #2
0
 def test_sending_email_without_html(self):
     """Html content is not attached when html block is missing"""
     self.render_mock.return_value = {
         SUBJECT: sentinel.subject,
         TEXT: sentinel.text
     }
     send_email(address=sentinel.address,
                template_name=sentinel.template_name,
                context=sentinel.context)
     self.assert_email_constructed()
     self.email_mock().send.assert_called_once()
예제 #3
0
파일: tests.py 프로젝트: D0han/saleor
 def test_sending_email_with_html(self):
     """Html content is attached when html block present"""
     self.render_mock.return_value = {SUBJECT: sentinel.subject,
                                      TEXT: sentinel.text,
                                      HTML: sentinel.html}
     send_email(address=sentinel.address,
                template_name=sentinel.template_name,
                context=sentinel.context)
     self.assert_email_constructed()
     self.email_mock().attach_alternative.assert_called_once_with(
         sentinel.html, 'text/html')
     self.email_mock().send.assert_called_once()
예제 #4
0
 def test_sending_email_with_html(self):
     """Html content is attached when html block present"""
     self.render_mock.return_value = {
         SUBJECT: sentinel.subject,
         TEXT: sentinel.text,
         HTML: sentinel.html
     }
     send_email(address=sentinel.address,
                template_name=sentinel.template_name,
                context=sentinel.context)
     self.assert_email_constructed()
     self.email_mock().attach_alternative.assert_called_once_with(
         sentinel.html, 'text/html')
     self.email_mock().send.assert_called_once()
예제 #5
0
파일: models.py 프로젝트: D0han/saleor
 def send_confirmation_email(self):
     email = self.order.get_user_email()
     order_url = build_absolute_uri(
         reverse('order:details', kwargs={'token': self.order.token}))
     context = {'order_url': order_url}
     send_email(email, 'payment/emails/confirm_email.txt', context)
예제 #6
0
 def send_confirmation_email(self):
     email = self.get_user_email()
     payment_url = build_absolute_uri(
         reverse('order:payment:index', kwargs={'token': self.token}))
     context = {'payment_url': payment_url}
     send_email(email, 'order/emails/confirm_email.txt', context)
예제 #7
0
 def send_confirmation_email(self):
     email = self.order.get_user_email()
     order_url = build_absolute_uri(
         reverse('order:details', kwargs={'token': self.order.token}))
     context = {'order_url': order_url}
     send_email(email, 'payment/emails/confirm_email.txt', context)
예제 #8
0
파일: forms.py 프로젝트: D0han/saleor
 def send(self):
     email = self.cleaned_data['email']
     request = self.create_request_instance()
     confirmation_url = self.local_host + request.get_confirmation_url()
     context = {'confirmation_url': confirmation_url}
     send_email(email, self.template, context)
예제 #9
0
파일: models.py 프로젝트: D0han/saleor
 def send_confirmation_email(self):
     email = self.get_user_email()
     payment_url = build_absolute_uri(
         reverse('order:payment:index', kwargs={'token': self.token}))
     context = {'payment_url': payment_url}
     send_email(email, 'order/emails/confirm_email.txt', context)
예제 #10
0
 def send(self):
     email = self.cleaned_data['email']
     request = self.create_request_instance()
     confirmation_url = self.local_host + request.get_confirmation_url()
     context = {'confirmation_url': confirmation_url}
     send_email(email, self.template, context)