@pytest.mark.django_db
def test_force_staff_sso(client):
    'Test that URLs and redirects are in place.'
    settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON'] = True
    settings.AUTHBROKER_CLIENT_ID = 'debug'
    settings.AUTHBROKER_CLIENT_SECRET = 'debug'
    settings.AUTHBROKER_URL = 'https://test.com'
    reload_urlconf()
    assert (reverse('authbroker_client:login') == '/auth/login/')
    assert (reverse('authbroker_client:callback') == '/auth/callback/')
    response = client.get('/admin/login/')
    assert (response.status_code == 302)
    assert (response.url == '/auth/login/')
    settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON'] = False
    reload_urlconf()
Test that URLs and redirects are in place.
@pytest.mark.django_db
def test_force_staff_sso(client):
    
    settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON'] = True
    settings.AUTHBROKER_CLIENT_ID = 'debug'
    settings.AUTHBROKER_CLIENT_SECRET = 'debug'
    settings.AUTHBROKER_URL = 'https://test.com'
    reload_urlconf()
    assert (reverse('authbroker_client:login') == '/auth/login/')
    assert (reverse('authbroker_client:callback') == '/auth/callback/')
    response = client.get('/admin/login/')
    assert (response.status_code == 302)
    assert (response.url == '/auth/login/')
    settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON'] = False
    reload_urlconf()