Commit b0a28dde77f88aa5c3ec7f8ed44141fb3ef49750
Exists in
master
Merge branch 'master' of git.ucsd.edu:110swag/flashy-backend
Showing 1 changed file Side-by-side Diff
flashcards/tests/test_api.py
View file @
b0a28dd
... | ... | @@ -34,11 +34,18 @@ |
34 | 34 | response = self.client.post(url, data, format='json') |
35 | 35 | self.assertEqual(response.status_code, HTTP_201_CREATED) |
36 | 36 | |
37 | - | |
38 | 37 | data = {'email': 'none@none.com', 'password': '1234'} |
39 | 38 | response = self.client.post('/api/login', data, format='json') |
40 | 39 | self.assertEqual(response.status_code, HTTP_200_OK) |
41 | 40 | |
41 | + | |
42 | + data = {'email': 'none@none.com'} | |
43 | + response = self.client.post(url, data, format='json') | |
44 | + self.assertContains(response, 'Password is required', status_code=400) | |
45 | + | |
46 | + data = {'password': '1234'} | |
47 | + response = self.client.post(url, data, format='json') | |
48 | + self.assertContains(response, 'Email is required', status_code=400) | |
42 | 49 | |
43 | 50 | class ProfileViewTest(APITestCase): |
44 | 51 | def test_get_me(self): |