Commit 17bef565 by David Baumgold

Added another test

parent 4155f9fe
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")
...@@ -73,7 +73,7 @@ def add_user(request, location): ...@@ -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 This POST-back view will add a user - specified by email - to the list of editors for
the specified course the specified course
''' '''
email = request.POST["email"] email = request.POST.get("email")
if not email: if not email:
msg = { msg = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment