mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 04:55:44 +00:00
disable tests that rely on old endpoints - to be replaced
This commit is contained in:
@ -82,6 +82,7 @@ $("#edit-user").on('click', function() {
|
||||
);
|
||||
});
|
||||
|
||||
/*
|
||||
$("#edit-password").on('click', function() {
|
||||
launchModalForm(
|
||||
"{% url 'set-password' %}",
|
||||
@ -90,3 +91,4 @@ $("#edit-password").on('click', function() {
|
||||
}
|
||||
);
|
||||
});
|
||||
*/
|
||||
|
@ -48,14 +48,14 @@ class UserAPITests(InvenTreeAPITestCase):
|
||||
|
||||
self.assertIn('name', response.data)
|
||||
|
||||
def test_logout(self):
|
||||
"""Test api logout endpoint."""
|
||||
token_key = self.get(url=reverse('api-token')).data['token']
|
||||
self.client.logout()
|
||||
self.client.credentials(HTTP_AUTHORIZATION='Token ' + token_key)
|
||||
# def test_logout(self):
|
||||
# """Test api logout endpoint."""
|
||||
# token_key = self.get(url=reverse('api-token')).data['token']
|
||||
# self.client.logout()
|
||||
# self.client.credentials(HTTP_AUTHORIZATION='Token ' + token_key)
|
||||
|
||||
self.post(reverse('api-logout'), expected_code=200)
|
||||
self.get(reverse('api-token'), expected_code=401)
|
||||
# self.post(reverse('api-logout'), expected_code=200)
|
||||
# self.get(reverse('api-token'), expected_code=401)
|
||||
|
||||
def test_login_redirect(self):
|
||||
"""Test login redirect endpoint."""
|
||||
@ -176,12 +176,12 @@ class UserTokenTests(InvenTreeAPITestCase):
|
||||
|
||||
self.client.get(me, expected_code=200)
|
||||
|
||||
def test_buildin_token(self):
|
||||
"""Test the built-in token authentication."""
|
||||
response = self.post(
|
||||
reverse('rest_login'),
|
||||
{'username': self.username, 'password': self.password},
|
||||
expected_code=200,
|
||||
)
|
||||
self.assertIn('key', response.data)
|
||||
self.assertTrue(response.data['key'].startswith('inv-'))
|
||||
# def test_buildin_token(self):
|
||||
# """Test the built-in token authentication."""
|
||||
# response = self.post(
|
||||
# reverse('rest_login'),
|
||||
# {'username': self.username, 'password': self.password},
|
||||
# expected_code=200,
|
||||
# )
|
||||
# self.assertIn('key', response.data)
|
||||
# self.assertTrue(response.data['key'].startswith('inv-'))
|
||||
|
@ -274,8 +274,9 @@ class OwnerModelTest(InvenTreeTestCase):
|
||||
class MFALoginTest(InvenTreeAPITestCase):
|
||||
"""Some simplistic tests to ensure that MFA is working."""
|
||||
|
||||
"""
|
||||
def test_api(self):
|
||||
"""Test that the API is working."""
|
||||
""Test that the API is working.""
|
||||
auth_data = {'username': self.username, 'password': self.password}
|
||||
login_url = reverse('api-login')
|
||||
|
||||
@ -313,3 +314,4 @@ class MFALoginTest(InvenTreeAPITestCase):
|
||||
# Wrong login should not work
|
||||
auth_data['password'] = 'wrong'
|
||||
self.post(login_url, auth_data, expected_code=401)
|
||||
"""
|
||||
|
Reference in New Issue
Block a user