Commits

James Bennett committed 89e11bb

Use the method on the User model for sending email.

Comments (0)

Files changed (2)

registration/models.py

         message = render_to_string('registration/activation_email.txt',
                                    ctx_dict)
         
-        send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [profile.user.email])
+        profile.user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL)
     
     def create_profile(self, user):
         """

registration/tests/models.py

         RegistrationProfile.objects.send_activation_email(profile,
                                                           Site.objects.get_current())
         self.assertEqual(len(mail.outbox), 1)
+        self.assertEqual(mail.outbox[0].to, [self.user_info['email']])
 
     def test_user_creation(self):
         """