2
0
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:
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() { $("#edit-password").on('click', function() {
launchModalForm( launchModalForm(
"{% url 'set-password' %}", "{% 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) self.assertIn('name', response.data)
def test_logout(self): # def test_logout(self):
"""Test api logout endpoint.""" # """Test api logout endpoint."""
token_key = self.get(url=reverse('api-token')).data['token'] # token_key = self.get(url=reverse('api-token')).data['token']
self.client.logout() # self.client.logout()
self.client.credentials(HTTP_AUTHORIZATION='Token ' + token_key) # self.client.credentials(HTTP_AUTHORIZATION='Token ' + token_key)
self.post(reverse('api-logout'), expected_code=200) # self.post(reverse('api-logout'), expected_code=200)
self.get(reverse('api-token'), expected_code=401) # self.get(reverse('api-token'), expected_code=401)
def test_login_redirect(self): def test_login_redirect(self):
"""Test login redirect endpoint.""" """Test login redirect endpoint."""
@ -176,12 +176,12 @@ class UserTokenTests(InvenTreeAPITestCase):
self.client.get(me, expected_code=200) self.client.get(me, expected_code=200)
def test_buildin_token(self): # def test_buildin_token(self):
"""Test the built-in token authentication.""" # """Test the built-in token authentication."""
response = self.post( # response = self.post(
reverse('rest_login'), # reverse('rest_login'),
{'username': self.username, 'password': self.password}, # {'username': self.username, 'password': self.password},
expected_code=200, # expected_code=200,
) # )
self.assertIn('key', response.data) # self.assertIn('key', response.data)
self.assertTrue(response.data['key'].startswith('inv-')) # self.assertTrue(response.data['key'].startswith('inv-'))

View File

@ -274,8 +274,9 @@ class OwnerModelTest(InvenTreeTestCase):
class MFALoginTest(InvenTreeAPITestCase): class MFALoginTest(InvenTreeAPITestCase):
"""Some simplistic tests to ensure that MFA is working.""" """Some simplistic tests to ensure that MFA is working."""
"""
def test_api(self): def test_api(self):
"""Test that the API is working.""" ""Test that the API is working.""
auth_data = {'username': self.username, 'password': self.password} auth_data = {'username': self.username, 'password': self.password}
login_url = reverse('api-login') login_url = reverse('api-login')
@ -313,3 +314,4 @@ class MFALoginTest(InvenTreeAPITestCase):
# Wrong login should not work # Wrong login should not work
auth_data['password'] = 'wrong' auth_data['password'] = 'wrong'
self.post(login_url, auth_data, expected_code=401) self.post(login_url, auth_data, expected_code=401)
"""