'Approval of an account functions properly.'

def test_approval(self):

    resp = self.client.post(reverse('registration_register'), data={'username': 'bob', 'email': 'bob@example.com', 'password1': 'secret', 'password2': 'secret'})
    profile = self.registration_profile.objects.get(user__username='bob')
    resp = self.client.get(reverse('registration_activate', args=(), kwargs={'activation_key': profile.activation_key}))
    admin_user = UserModel().objects.create_superuser('admin', 'admin@test.com', 'admin')
    self.client.login(username=admin_user.username, password=admin_user)
    resp = self.client.get(reverse('registration_admin_approve', args=(), kwargs={'profile_id': profile.id}))
    user = profile.user
    self.failIf((not user.is_active))
    self.assertRedirects(resp, reverse('registration_approve_complete'))
