'Test the admin custom command \'activate users\''

def test_activate_users(self):

    new_user = UserModel().objects.create_user(**self.user_info)
    profile = RegistrationProfile.objects.create_profile(new_user)
    self.assertFalse(profile.activated)
    registrationprofile_list = urlresolvers.reverse(u'admin:registration_registrationprofile_changelist')
    post_data = {u'action': u'activate_users', helpers.ACTION_CHECKBOX_NAME: [profile.pk]}
    self.client.post(registrationprofile_list, post_data, follow=True)
    profile = RegistrationProfile.objects.get(user=new_user)
    self.assertTrue(profile.activated)
