@pytest.mark.django_db
def test_edit_user_view_warns_administrator_if_user_is_awaiting_approval(admin_client, user_awaiting_approval):
    settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON'] = True
    user = user_awaiting_approval
    url = reverse('wagtailusers_users:edit', kwargs={'pk': user.pk})
    response = admin_client.get(url)
    message = response.context['message']
    assert ('This user is awaiting approval' in message)
    assert ("requested to be added to the 'Moderators' group" in message)
    settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON'] = False
    reload_urlconf()
@pytest.mark.django_db
def test_edit_user_view_warns_administrator_if_user_is_awaiting_approval(admin_client, user_awaiting_approval):
    settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON'] = True
    user = user_awaiting_approval
    url = reverse('wagtailusers_users:edit', kwargs={'pk': user.pk})
    response = admin_client.get(url)
    message = response.context['message']
    assert ('This user is awaiting approval' in message)
    assert ("requested to be added to the 'Moderators' group" in message)
    settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON'] = False
    reload_urlconf()