Switch existing tests to use the newer endpoint.

This commit is contained in:
Diana Huang
2018-09-25 16:10:00 -04:00
parent 65ab430c04
commit deb8bd47d9
4 changed files with 30 additions and 40 deletions

View File

@@ -194,11 +194,9 @@ class LoginEnrollmentTestCase(TestCase):
"""
Login, check that the corresponding view's response has a 200 status code.
"""
resp = self.client.post(reverse('login'),
resp = self.client.post(reverse('user_api_login_session'),
{'email': email, 'password': password})
self.assertEqual(resp.status_code, 200)
data = json.loads(resp.content)
self.assertTrue(data['success'])
def logout(self):
"""
@@ -212,7 +210,7 @@ class LoginEnrollmentTestCase(TestCase):
"""
Create the account and check that it worked.
"""
url = reverse('create_account')
url = reverse('user_api_registration')
request_data = {
'username': username,
'email': email,
@@ -222,8 +220,6 @@ class LoginEnrollmentTestCase(TestCase):
'honor_code': 'true',
}
resp = self.assert_request_status_code(200, url, method="POST", data=request_data)
data = json.loads(resp.content)
self.assertEqual(data['success'], True)
# Check both that the user is created, and inactive
user = User.objects.get(email=email)
self.assertFalse(user.is_active)