Don't redirect to a login page when responding to json messages.

Also update tests to actually check all our URLs.

(imported from commit 86de2027d140da6118e2f2f60c1c86511b16c141)
This commit is contained in:
Tim Abbott
2012-10-16 16:10:48 -04:00
parent 3e994c16b7
commit a859c10017
3 changed files with 39 additions and 17 deletions

View File

@@ -109,9 +109,21 @@ class PublicURLTest(TestCase):
Pages that should return a 200 when not logged in.
"""
urls = {200: ["/accounts/home/", "/accounts/login/", "/accounts/logout/"],
302: ["/", "/json/send_message/", "/json/subscriptions/list",
"/json/subscriptions/remove", "/json/subscriptions/add"],
400: ["/accounts/register/"],
302: ["/"],
400: ["/accounts/register/",
"/api/v1/get_messages",
"/api/v1/get_public_streams",
"/api/v1/get_subscriptions",
"/api/v1/subscribe",
"/api/v1/send_message",
"/json/send_message/",
"/json/update_pointer",
"/json/get_updates",
"/json/settings/change/",
"/json/subscriptions/list",
"/json/subscriptions/remove",
"/json/subscriptions/exists/test",
"/json/subscriptions/add"],
}
for status_code, url_set in urls.iteritems():
self.fetch(url_set, status_code)