Added another test

This commit is contained in:
David Baumgold
2013-07-03 15:46:10 -04:00
parent 4155f9fe8c
commit 17bef565f1
2 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
import json
from .utils import CourseTestCase
from django.core.urlresolvers import reverse
class UsersTestCase(CourseTestCase):
def setUp(self):
super(UsersTestCase, self).setUp()
self.url = reverse("add_user", kwargs={"location": ""})
def test_empty(self):
resp = self.client.post(self.url)
self.assertEqual(resp.status_code, 400)
content = json.loads(resp.content)
self.assertEqual(content["Status"], "Failed")

View File

@@ -73,7 +73,7 @@ def add_user(request, location):
This POST-back view will add a user - specified by email - to the list of editors for
the specified course
'''
email = request.POST["email"]
email = request.POST.get("email")
if not email:
msg = {