2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

disable tests that rely on old endpoints - to be replaced

This commit is contained in:
Matthias Mair
2024-06-25 20:39:40 +02:00
parent daacfaf580
commit bb40d134e1
3 changed files with 21 additions and 17 deletions

View File

@ -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() {
}
);
});
*/

View File

@ -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-'))

View File

@ -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)
"""