'User can change users he created if can_change_permissions
is set to True.'

def test_user_can_change_subordinate(self):

    staff_user = self.get_staff_user_with_no_permissions()
    subordinate = self.get_staff_page_user(created_by=staff_user)
    endpoint = self.get_admin_url(PageUser, 'change', subordinate.pk)
    data = model_to_dict(subordinate, exclude=['date_joined'])
    data['_continue'] = '1'
    data['date_joined_0'] = '2016-06-21'
    data['date_joined_1'] = '15:00:00'
    self.add_permission(staff_user, 'change_pageuser')
    self.add_page_permission(staff_user, self._permissions_page, can_change_permissions=True)
    if (subordinate.USERNAME_FIELD != 'email'):
        username = 'perms-testuser2'
    else:
        username = 'perms-testuser+2@django-cms.org'
    data[subordinate.USERNAME_FIELD] = username
    with self.login_user_context(staff_user):
        response = self.client.post(endpoint, data)
        self.assertRedirects(response, endpoint)
        self.assertTrue(self._user_exists(username))
