mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 03:25:42 +00:00
fix assertations
This commit is contained in:
@ -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
|
||||
|
@ -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')
|
||||
|
@ -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"""
|
||||
|
Reference in New Issue
Block a user