fix(api): accept slashless api urls
This commit is contained in:
@@ -113,6 +113,16 @@ class LoginViewTest(APITestCase):
|
||||
self.assertIn("refresh", response.data)
|
||||
self.assertIn("access", response.data)
|
||||
|
||||
def test_login_accepts_slashless_api_url(self):
|
||||
"""Frontend clients can call API URLs without Django's trailing slash."""
|
||||
response = self.client.post(
|
||||
self.login_url.rstrip("/"), self.login_data, format="json"
|
||||
)
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
self.assertIn("refresh", response.data)
|
||||
self.assertIn("access", response.data)
|
||||
|
||||
def test_login_invalid_credentials(self):
|
||||
"""Test login fails with invalid credentials"""
|
||||
data = self.login_data.copy()
|
||||
|
||||
Reference in New Issue
Block a user