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 _testrefastpath(repat):
    """Test if a re pattern can use fast path.

    That is, for every "$A/$B" path the pattern matches, "$A" must also be
    matched,

    Return True if we're sure it is. Return False otherwise.
    """
    # XXX: It's very hard to implement this. These are what need to be
    # supported in production and tests. Very hacky. But we plan to get rid
    # of re matchers eventually.

    # Rules like "(?!experimental/)"
    if repat.startswith("(?!") and repat.endswith(")") and repat.count(")") == 1:
        return True

    # Rules used in doctest
    if repat == "(i|j)$":
        return True

    return False