Added another test
This commit is contained in:
15
cms/djangoapps/contentstore/tests/test_users.py
Normal file
15
cms/djangoapps/contentstore/tests/test_users.py
Normal 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")
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user