'Test resending activation email to an existing user'

def test_resend_activation_email(self):

    user = self.registration_profile.objects.create_inactive_user(site=Site.objects.get_current(), send_email=False, **self.user_info)
    self.assertEqual(len(mail.outbox), 0)
    profile = self.registration_profile.objects.get(user=user)
    orig_activation_key = profile.activation_key
    self.assertTrue(self.registration_profile.objects.resend_activation_mail(email=self.user_info['email'], site=Site.objects.get_current()))
    profile = self.registration_profile.objects.get(pk=profile.pk)
    new_activation_key = profile.activation_key
    self.assertNotEqual(orig_activation_key, new_activation_key)
    self.assertEqual(len(mail.outbox), 1)
