'Test the admin custom command \'resend activation email\''

def test_resend_activation_email(self):

    new_user = UserModel().objects.create_user(**self.user_info)
    profile = RegistrationProfile.objects.create_profile(new_user)
    registrationprofile_list = urlresolvers.reverse(u'admin:registration_registrationprofile_changelist')
    post_data = {u'action': u'resend_activation_email', helpers.ACTION_CHECKBOX_NAME: [profile.pk]}
    self.client.post(registrationprofile_list, post_data, follow=True)
    self.assertEqual(len(mail.outbox), 1)
    self.assertEqual(mail.outbox[0].to, [self.user_info[u'email']])
