def test_anonymous_get_requests_redirected_to_index(self):
        self.client.logout()

        response = self.client.get(reverse('results-export'), follow=True)
        self.assertRedirects(response, '/?next=%2Fadmin%2Fresults')
def patched_cnli(monkeypatch):
    MockCapsNumLockIndicator.reset()
    monkeypatch.setattr(
        "libqtile.widget.caps_num_lock_indicator.subprocess", MockCapsNumLockIndicator
    )
    monkeypatch.setattr(
        "libqtile.widget.caps_num_lock_indicator.subprocess.CalledProcessError",
        subprocess.CalledProcessError,
    )

    monkeypatch.setattr(
        "libqtile.widget.caps_num_lock_indicator.base.ThreadPoolText.call_process",
        MockCapsNumLockIndicator.call_process,
    )
    return caps_num_lock_indicator