Permalink
Browse files

Added unauthorized event tests

  • Loading branch information...
1 parent 445bc3a commit 8c30aa5c9c8f29ced33dc876fd57e4af665b8bc2 @alexsikora committed Apr 15, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 events/tests.py
View
@@ -46,6 +46,10 @@ def test_get_events(self):
self.assertEqual(result['status_code'], 200)
self.assertEqual(result['response'][0]['name'], 'MLG')
+ def test_get_events_unauthorized(self):
+ response = self.client.post('/events/allevents/', {})
+ self.assertEqual(response.status_code, 401)
+
def test_get_event(self):
response = self.client.post('/events/get_event/?id=1', {}, **self.extra)
self.assertEqual(response.status_code, 200)
@@ -56,6 +60,10 @@ def test_get_event(self):
self.assertEqual(result['status_code'], 200)
self.assertEqual(result['response']['name'], 'MLG')
+ def test_get_event_unauthorized(self):
+ response = self.client.post('/events/get_event/?id=1', {})
+ self.assertEqual(response.status_code, 401)
+
def test_get_nonexistent_event(self):
response = self.client.post('/events/get_event/?id=2', {}, **self.extra)
self.assertEqual(response.status_code, 200)
@@ -66,3 +74,4 @@ def test_get_nonexistent_event(self):
self.assertEqual(result['status_code'], 404)
self.assertEqual(result['response'], "Event does not exist")
+

0 comments on commit 8c30aa5

Please sign in to comment.