2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 11:35:41 +00:00

fix assertations

This commit is contained in:
Matthias Mair
2024-10-28 22:05:25 +01:00
parent b8cfe0e8a2
commit 324f93cdbd
3 changed files with 4 additions and 7 deletions

View File

@ -32,16 +32,13 @@ class MiddlewareTests(InvenTreeTestCase):
# logout
self.client.logout()
# check that account things go through
self.check_path(reverse('account_login'))
# check that account things are rereouted
self.check_path(reverse('account_login'), 302)
# check that frontend code is redirected to login
response = self.check_path(reverse('stats'), 302)
self.assertEqual(response.url, '/accounts/login/?next=/stats/')
# check that a 401 is raised
self.check_path(reverse('settings.js'), 401)
def test_token_auth(self):
"""Test auth with token auth."""
# get token

View File

@ -49,4 +49,4 @@ class ViewTests(InvenTreeTestCase):
f'/accounts/login/?next=/&login={self.username}&password={self.password}'
)
self.assertEqual(response.status_code, 302)
self.assertEqual(response.url, '/')
self.assertEqual(response.url, '/platform')

View File

@ -44,7 +44,7 @@ class BuildTestSimple(InvenTreeTestCase):
def test_url(self):
"""Test URL lookup"""
b1 = Build.objects.get(pk=1)
self.assertEqual(b1.get_absolute_url(), 'TOBEREFACTORED')
self.assertEqual(b1.get_absolute_url(), '/platform/manufacturing/build-order/1')
def test_is_complete(self):
"""Test build completion status"""