'Test which views are accessible when not logged in.'

def test_public_urls(self):

    denmark_stream_id = Stream.objects.get(name='Denmark').id
    get_urls = {200: ['/accounts/home/', '/accounts/login//en/accounts/home/', '/ru/accounts/home/', '/en/accounts/login/', '/ru/accounts/login/', '/help/'], 302: ['/', '/en/', '/ru/'], 401: [('/json/streams/%d/members' % (denmark_stream_id,)), '/api/v1/users/me/subscriptions', '/api/v1/messages', '/json/messages', '/api/v1/streams'], 404: ['/help/nonexistent']}
    for doc in os.listdir('./templates/zerver/help'):
        if (doc.startswith('.') or ('~' in doc) or ('#' in doc)):
            continue
        if (doc not in {'main.html', 'index.md', 'include'}):
            get_urls[200].append(('/help/' + os.path.splitext(doc)[0]))
    post_urls = {200: ['/accounts/login/'], 302: ['/accounts/logout/'], 401: ['/json/messages', '/json/invites', '/json/subscriptions/exists', '/api/v1/users/me/subscriptions/properties', '/json/fetch_api_key', '/json/users/me/pointer', '/json/users/me/subscriptions', '/api/v1/users/me/subscriptions'], 400: ['/api/v1/external/github', '/api/v1/fetch_api_key']}
    patch_urls = {401: ['/json/settings']}
    put_urls = {401: ['/json/users/me/pointer']}
    for (status_code, url_set) in six.iteritems(get_urls):
        self.fetch('client_get', url_set, status_code)
    for (status_code, url_set) in six.iteritems(post_urls):
        self.fetch('client_post', url_set, status_code)
    for (status_code, url_set) in six.iteritems(patch_urls):
        self.fetch('client_patch', url_set, status_code)
    for (status_code, url_set) in six.iteritems(put_urls):
        self.fetch('client_put', url_set, status_code)
