Commit 3c64c86e by Matt Drayer Committed by Jonathan Piacenti

mattdrayer/api-userscleanup: Added docstrings and changed to fail-fast style

parent 2a923bdc
......@@ -126,7 +126,7 @@ class UsersApiTests(TestCase):
response = self.do_post(test_uri, data)
self.assertEqual(response.status_code, 409)
self.assertGreater(response.data['message'], 0)
self.assertEqual(response.data['field_conflict'], 'username')
self.assertEqual(response.data['field_conflict'], 'username or email')
def test_user_detail_get(self):
test_uri = '/api/users'
......@@ -582,7 +582,7 @@ class UsersApiTests(TestCase):
display_name="Chapter 1"
)
user_id = 2342334
course_id = 'asdfa9sd8fasdf'
course_id = 'asd/fa/9sd8fasdf'
test_uri = '/api/users/{}/courses/{}'.format(str(user_id), course_id)
position_data = {
'position': {
......@@ -661,7 +661,7 @@ class UsersApiTests(TestCase):
self.assertEqual(response.data['position'], chapter1.id)
def test_user_courses_detail_get_undefined_user(self):
test_uri = '/api/users/2134234/courses/a8df7asvd98'
test_uri = '/api/users/2134234/courses/a8df7/asv/d98'
response = self.do_get(test_uri)
self.assertEqual(response.status_code, 404)
......
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