def test_update(self):
    self.login(self.superuser)
    url = reverse('profiles.admin_update', args=[self.user1.pk])
    data = {'full_name': 'Mo Polls', 'email': 'example@example.com', 'new_password': 'abc123xy', 'confirm_password': 'abc123xy', 'is_active': False, 'is_superuser': True}
    response = self.url_post('unicef', url, data)
    self.assertEqual(response.status_code, 302)
    user = User.objects.get(email='example@example.com')
    self.assertEqual(user.profile.full_name, 'Mo Polls')
    self.assertFalse(user.is_active)
    self.assertTrue(user.is_superuser)
    self.assertEqual(user, authenticate(username=user.username, password='abc123xy'))
    data = {'full_name': 'Mo Polls', 'email': 'example@example.com', 'is_active': True, 'is_superuser': False}
    response = self.url_post('unicef', url, data)
    self.assertEqual(response.status_code, 302)
    user = User.objects.get(email='example@example.com')
    self.assertEqual(user.profile.full_name, 'Mo Polls')
    self.assertTrue(user.is_active)
    self.assertFalse(user.is_superuser)
    self.assertEqual(user, authenticate(username=user.username, password='abc123xy'))
def test_update(self):
    self.login(self.superuser)
    url = reverse('profiles.admin_update', args=[self.user1.pk])
    data = {'full_name': 'Mo Polls', 'email': 'example@example.com', 'new_password': 'abc123xy', 'confirm_password': 'abc123xy', 'is_active': False, 'is_superuser': True}
    response = self.url_post('unicef', url, data)
    self.assertEqual(response.status_code, 302)
    user = User.objects.get(email='example@example.com')
    self.assertEqual(user.profile.full_name, 'Mo Polls')
    self.assertFalse(user.is_active)
    self.assertTrue(user.is_superuser)
    self.assertEqual(user, authenticate(username=user.username, password='abc123xy'))
    data = {'full_name': 'Mo Polls', 'email': 'example@example.com', 'is_active': True, 'is_superuser': False}
    response = self.url_post('unicef', url, data)
    self.assertEqual(response.status_code, 302)
    user = User.objects.get(email='example@example.com')
    self.assertEqual(user.profile.full_name, 'Mo Polls')
    self.assertTrue(user.is_active)
    self.assertFalse(user.is_superuser)
    self.assertEqual(user, authenticate(username=user.username, password='abc123xy'))